3 ms·
Things like pydantic and fastapi where the type annotations are used for run time argument validation and interface generation.
by ok123456 4y ago
Things like pydantic and fastapi where the type annotations are used for run time argument validation and interface generation.
- deleted 4y ago[deleted]
- whimsicalism 4y agoDoes this still work with Python 3.10 changes removing runtime evaluation of type annotations? I seem to recall this screwed me when I was writing something for runtime usage of types.
- BiteCode_dev 4y agoThere was a heated debate because it broke things at the time, but now it works, yes.
- patrick91 4y agowe still don't know what's going to happen with type hints in future though, but I'm sure things won't break as they might have broken if they changed the default behaviour
- whimsicalism 4y agoOh it looks like they actually pushed back the PEP 563 changes.. From this thread [0] it does not look open and shut that it will work once these changes go into effect. [0]: https://github.com/pydantic/pydantic/issues/2678 https://github.com/pydantic/pydantic/issues/2678
- LtWorf 4y agoThey postponed that change. It remained enabled with a future and while it kinda works, it doesn't work in all cases. Non top level definitions can never be retrieved basically.