[Python-Dev] Re: Proto-PEP part 1: Forward declaration of classes

2022年4月25日 18:03:27 -0700

On 4/25/2022 1:10 PM, Jim J. Jewett wrote:
(That said, my personal opinion is that this is pretty heavyweight for very 
little gain; why not just create a placeholder class that static analysis tools 
are supposed to recognize as likely-to-be-replaced later? And why not just 
use strings giving the expected eventual class name? It isn't as though the 
analysis can verify whether something actually meets the full intended contract 
before they've also parsed the continuation.)
The experience with PEP 563 shows that string annotations make things much more difficult for dataclasses and other users of runtime type annotations. The point of PEP 649 and the forward declaration of classes is to make it possible to remove string annotations entirely.
Eric
_______________________________________________
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/ZO7M5NCQKR7EPHRVUALRSH2RCKMT5YX7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to