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)