On 8/10/21 11:15 AM, Thomas Grainger wrote:
Although the co_annoations code could intercept the NameError and replace
return a ForwardRef object instead of the resolved name
No, it should raise a NameError, just like any other Python code.
Annotations aren't special enough to break the rules.
I worry about Python-the-language enshrining design choices made by the
typing module. Python is now on its fourth string interpolation
technology, and it ships with three command-line argument parsing
libraries; in each of these cases, we were adding a New Thing that was
viewed at the time as an improvement over the existing thing(s). It'd
be an act of hubris to assert that the current "typing" module is the
ultimate, final library for expressing type information in Python. But
if we tie the language too strongly to the typing module, I fear we
could strangle its successors in their cribs.
//arry/
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/5NUVYOLIHEHS373WEK3D2ZGXSWPI5XV7/
Code of Conduct: http://python.org/psf/codeofconduct/