For example, if an attribute is added dynamically during __init__. But that’s why the type hint stuff is great, because it means you can have the cake and eat it too:
- Type hints /decorators only ⇝ static checking
- Subclassing ABC ⇝ uses type hints / decorators to automatically generate runtime checks
Generally not, in many simple cases you can. But more crucially I think the runtime-check is about verifying the attribute/method exists at all. For example, if you work a lot in interactive notebooks the runtime checks are pretty useful since the static checking support is limited.