Status of PEP 649 -- Deferred Evaluation Of Annotations Using Descriptors

Hi Larry, Can you give us a status update for your PEP 649? I don't recall reading anything about it in the past few weeks. I am super excited about this solution to the problem (even if there are a few issues to work through) and I think it will provide better backwards compatibility than the current plan for Python 3.10 (PEP 563, from __future__ import annotations, causing all annotations to be stringified). If we don't get this into 3.10, we'd have a much more complicated transition. There are only two more alphas before 3.10b1 gets released! And we'd have to get this approved by the Steering Council, which can take a few weeks (cut them some slack, they have a big backlog). Fortunately you already have an implementation that can be landed quickly once the PEP is accepted. -- --Guido van Rossum (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-c...>

After working on it and stressing out about it for some months, I decided to take a break and scratch some other itches. I'll return to PEP 649 soon, and I have every intention of having the PEP done and the prototype done well in advance of 3.10b1--worry not. Thanks for checking in, //arry/ On 2/4/21 9:17 AM, Guido van Rossum wrote:

Breaks are good. Looking forward to the next prototype! On Thu, Feb 4, 2021 at 10:45 AM Larry Hastings <larry@hastings.org> wrote:
-- --Guido van Rossum (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-c...>

Hi Larry, I have the same question as Guido last month. I'd really like to see some version of PEP 649 go into 3.10; is there anything I can do to help? I opened https://github.com/larryhastings/co_annotations/issues/1 to discuss what seems to be the main problem identified in the previous discussion. El jue, 4 feb 2021 a las 10:59, Guido van Rossum (<guido@python.org>) escribió:

Since my last post on the subject I have pretty much given up on PEP 649 in favor of what we have in 3.10alpha6 -- annotations are always stringified. The two problems brought up by Joseph Perez in particular seem too thorny to try and devise a solution for. Jelle, could you explain why for your use cases PEP 649 is preferred over PEP 563? On Sat, Mar 27, 2021 at 7:35 AM Jelle Zijlstra <jelle.zijlstra@gmail.com> wrote:
-- --Guido van Rossum (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-c...>

El sáb, 27 mar 2021 a las 15:37, Guido van Rossum (<guido@python.org>) escribió: like in PEP 649 so I wouldn't have to worry about scoping. Consider code like this: def make_function(return_type): def f() -> return_type: pass return f int_func = make_function(int) Currently, I can look at int_func.__annotations__ and see that the return type is int, but with stringified annotations it's just "return_type" and I have no way to get int out. Now, PEP 649 doesn't actually fix this at the moment, since it still resolves all annotations in the global scope, but that's easily fixed by removing the special case in https://github.com/larryhastings/co_annotations/blob/co_annotations/Python/c... .

On 3/27/21 4:23 PM, Jelle Zijlstra wrote:
Maybe not "easily fixed", because in my experience dealing with the compiler and symtable modules in CPython, nothing is easy. That special case was instrumental in getting the first revision working. Nevertheless, you're right in that it shouldn't be necessary, and "round 2" of 649 will remove it. Cheers, //arry/

After working on it and stressing out about it for some months, I decided to take a break and scratch some other itches. I'll return to PEP 649 soon, and I have every intention of having the PEP done and the prototype done well in advance of 3.10b1--worry not. Thanks for checking in, //arry/ On 2/4/21 9:17 AM, Guido van Rossum wrote:

Breaks are good. Looking forward to the next prototype! On Thu, Feb 4, 2021 at 10:45 AM Larry Hastings <larry@hastings.org> wrote:
-- --Guido van Rossum (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-c...>

Hi Larry, I have the same question as Guido last month. I'd really like to see some version of PEP 649 go into 3.10; is there anything I can do to help? I opened https://github.com/larryhastings/co_annotations/issues/1 to discuss what seems to be the main problem identified in the previous discussion. El jue, 4 feb 2021 a las 10:59, Guido van Rossum (<guido@python.org>) escribió:

Since my last post on the subject I have pretty much given up on PEP 649 in favor of what we have in 3.10alpha6 -- annotations are always stringified. The two problems brought up by Joseph Perez in particular seem too thorny to try and devise a solution for. Jelle, could you explain why for your use cases PEP 649 is preferred over PEP 563? On Sat, Mar 27, 2021 at 7:35 AM Jelle Zijlstra <jelle.zijlstra@gmail.com> wrote:
-- --Guido van Rossum (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-c...>

El sáb, 27 mar 2021 a las 15:37, Guido van Rossum (<guido@python.org>) escribió: like in PEP 649 so I wouldn't have to worry about scoping. Consider code like this: def make_function(return_type): def f() -> return_type: pass return f int_func = make_function(int) Currently, I can look at int_func.__annotations__ and see that the return type is int, but with stringified annotations it's just "return_type" and I have no way to get int out. Now, PEP 649 doesn't actually fix this at the moment, since it still resolves all annotations in the global scope, but that's easily fixed by removing the special case in https://github.com/larryhastings/co_annotations/blob/co_annotations/Python/c... .

On 3/27/21 4:23 PM, Jelle Zijlstra wrote:
Maybe not "easily fixed", because in my experience dealing with the compiler and symtable modules in CPython, nothing is easy. That special case was instrumental in getting the first revision working. Nevertheless, you're right in that it shouldn't be necessary, and "round 2" of 649 will remove it. Cheers, //arry/
participants (3)
-
Guido van Rossum
-
Jelle Zijlstra
-
Larry Hastings