[Python-Dev] Re: PEP 649: Deferred Evaluation Of Annotations Using Descriptors, round 2

2021年4月12日 06:21:27 -0700

On Sun, 2021年04月11日 at 23:34 -0700, Larry Hastings wrote:
> Your example was valid, and I think your workaround should be fine. 
> Do you have a use case for this, or is this question motivated purely
> by curiosity?
It took a few readings for me to understand the limitations in the PEP.
My example and workaround were mostly for me to confirm I had read it
correctly. 
> It's fine to modify the __annotations__ dict after the creation of
> the class or module. It's code that modifies "__annotations__" from
> within the class or module that is disallowed here. Similarly for
> dataclasses; once it creates a class object, it can explicitly set
> and / or modify the annotations dict on that class.
Thanks. I think this clarification should be added to the PEP.
Paul
_______________________________________________
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/6OTLAO3XOO2DVAGJOL4Q4LKPLCMLI3FZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to