Re:Show HN: Prisma Python – A fully typed ORM for Python
by probablyrobert on Monday February 21, 2022 @01:39PM
(#30419124)
There is actually an escape hatch you can use, although it is a bit clunky:
```py
from typing import TYPE_CHECKING
if TYPE_CHECKING:
Foo = "expression that mypy can understand"
else:
Foo = "dynamic expression"
```
Re:Show HN: Prisma Python – A fully typed ORM for Python
by samwillis on Monday February 21, 2022 @01:47PM
(#30419229)
Somehow in all my searching the other day I missed that, thanks!
Re:Show HN: Prisma Python – A fully typed ORM for Python
by BerislavLopac on Monday February 21, 2022 @03:42PM
(#30420346)
Python also offers structural typing, which is both dynamic and mypy-compatible.
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.