Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Things like pydantic and fastapi where the type annotations are used for run time argument validation and interface generation.


Does 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.


They 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.


There was a heated debate because it broke things at the time, but now it works, yes.


Oh 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


we 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: