Vladimir

45%
Flag icon
If you’re using an external type checker, there is one advantage of explict isinstance checks: when you write an if statement where the condition is isinstance(o, MyType), then Mypy can infer that inside the if block, the type of the o object is consistent-with MyType.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview