Some prior discussions:
"PEP 563 in light of PEP 649":
https://mail.python.org/archives/list/python-dev@python.org/message/ZBJ7MD6CSGM6LZAOTET7GXAVBZB7O77O/
"In support of PEP 649":
https://mail.python.org/archives/list/python-dev@python.org/message/7VMJWFGHVXDSRQFHMXVJKDDOVT47B54T/
"PEP 563 and 649: The Great Compromise":
https://mail.python.org/archives/list/python-dev@python.org/message/WUZGTGE43T7XV3EUGT6AN2N52OD3U7AE/
I'm sure there are other threads I missed.
--
Eric
On 8/9/2021 11:27 AM, Eric V. Smith wrote:
I'd like to revive the discussion of PEP 649
[https://www.python.org/dev/peps/pep-0649/] that started shortly
before development of 3.10 features was closed. This is Larry's PEP to
defer evaluation of __annotations__ until it's actually accessed.
During the discussion the decision was made to back out the change
that made "from __future__ import annotations" (PEP 563
[https://www.python.org/dev/peps/pep-0563/]) the default behavior for
3.10.
My understanding is that PEP 649 is currently in front of the SC. But
do we need to have any additional discussion here? My recollection is
that we backed out the PEP 563 change because we didn't feel we had
enough time to come to a good decision one way or the other before 3.10.
Personally, I'd like to see PEP 649 accepted. There are a number of
issues on bpo where people expect dataclass's field.type to be an
actual Python object representing a type, and not a string. This field
is copied directly from __annotations__. If we stick with PEP 563's
string annotations, I'll probably just close these issues as "won't
fix", and tell the caller they need to convert the strings to Python
objects themselves. If 649 is accepted, then they'll all get their
wish, and in addition I can remove some ugly logic from dataclasses.
Do we need to do anything here to move forward on this issue? I've
chatted with Larry and Mark Shannon, who have some additional thoughts
and I'm sure will chime in.
--
Eric V. Smith
_______________________________________________
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/H2RZWUHNG4OROL66KIOYHV5PXKILZIAM/
Code of Conduct: http://python.org/psf/codeofconduct/