Re:Untyped Python: The Python That Was
by kamikaz1k on Saturday December 02, 2023 @08:21PM
(#38503929)
Are they evaluated at runtime? Or just when the bytecode is generated? (Is that considered runtime?)
[ Parent
| on HN ]
Re:Untyped Python: The Python That Was
by lawrencejgd on Sunday December 03, 2023 @12:46AM
(#38505141)
They're evaluated at runtime, but CPython never checks if type hints are right or not. If you use "from __future__ import annotations" then they're converted to strings, so they could even have references to objects that don't exists (this is for a better performance).