Vladimir

45%
Flag icon
when defining a typing.Protocol subclass, you can use the @runtime_checkable decorator to make that protocol support isinstance/issubclass checks at runtime. This works because typing.Protocol is an ABC, therefore it supports the __subclasshook__
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview