by samwillis · 4y ago · 0 comments
It unfortunately leaves you with a choice of either taking advantage of dynamic annotations or using MyPy, but not both.
And as the sibling comment says, typescript did it so much better.
```py
from typing import TYPE_CHECKING
if TYPE_CHECKING:
Foo = "expression that mypy can understand"
else:
Foo = "dynamic expression"
```