Yes, PEP 649 is completely agnostic about what values you put in as
annotations. You can put in strings, complex objects,
expressions--whatever you put in, you get back out later.
I'm happy to add some text to the PEP if this needs clarifying; I just
thought it was obvious.
Cheers,
//arry/
On 1/11/21 9:11 PM, Guido van Rossum wrote:
Another thought about this PEP (hopefully my last one tonight).
The section on backwards compatibility doesn't mention what should
happen with annotations that are stringified by the user (as is needed
for forward references in code that hasn't been PEP-563-ified yet).
That's a PEP 484 feature. Should we start deprecating that at the same
time? Static checkers support it but don't need it (for example, stubs
in typeshed don't use it since their code is never evaluated).
At the very least I think your PEP should mention what happens for
these -- presumably `__annotations__` will just contain the string
literal, so get_type_hints() would be needed to evaluate these.
--
--Guido van Rossum (python.org/~guido <http://python.org/~guido>)
/Pronouns: he/him //(why is my pronoun here?)/
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/7Q3SHNMRKLROBESEB2U4NNMZAFS2XFRU/
Code of Conduct: http://python.org/psf/codeofconduct/