12 ms·
Isn’t this solved in 3.14/PEP-649?
by dandiep 1y ago
Isn’t this solved in 3.14/PEP-649?
- analog31 1y agoAt last, Pi-thon.
- aw1621107 1y agoI want to say it (or something similar at least) was originally addressed by from __future__ import annotations back in Python 3.7/3.8 or thereabouts? I definitely remember having to use stringified types a while back but I haven't needed to for quite a while now.
- sgarland 1y agoYes, annotations allows you to use the declared types as they are, no strings.
- FreakLegion 1y agoIt turns them into thunks (formerly strings) automatically, an important detail if you're inspecting annotations at run time because the performance hit of resolving the actual type can be significant.
- sgarland 1y agoTIL, thanks! It looks like 3.14 is also changing it so that all evaluations are lazy.