Should I postpone PEP 558 (locals() semantics) to Python 3.9?

Hi folks, The reference implementation for PEP 558 (my attempt to fix the interaction between tracing functions and closure variables) is currently segfaulting somewhere deep in the garbage collector, and I've found that there's an issue with the PyEval_GetLocals() API returning a borrowed reference that means I need to tweak the proposed C API a bit such that PyEval_GetLocals() returns the proxy at function scope, and we add a new PyEval_GetPyLocals() that matches the locals() builtin. I don't *want* to postpone this to Python 3.9, but there turned out to be more remaining work than I thought there was to get this ready for inclusion in beta 1. I'll try to get the C API design details sorted today, but the segfault is mystifying me, and prevents the option of putting the core implementation in place for b1, and tidying up the documentation and comments for b2. Cheers, Nick.

Given the flurry of discussion that happened this week, and that the PR switching the PEP to use independent snapshots hasn't even been landed, I'm skeptical that it's wise to attempt to get this in before beta 1 even if you were to resolve the segfaults. On Thu, May 30, 2019 at 4:24 PM Nick Coghlan <ncoghlan@gmail.com> wrote:
Hi folks,
The reference implementation for PEP 558 (my attempt to fix the interaction between tracing functions and closure variables) is currently segfaulting somewhere deep in the garbage collector, and I've found that there's an issue with the PyEval_GetLocals() API returning a borrowed reference that means I need to tweak the proposed C API a bit such that PyEval_GetLocals() returns the proxy at function scope, and we add a new PyEval_GetPyLocals() that matches the locals() builtin.
I don't *want* to postpone this to Python 3.9, but there turned out to be more remaining work than I thought there was to get this ready for inclusion in beta 1.
I'll try to get the C API design details sorted today, but the segfault is mystifying me, and prevents the option of putting the core implementation in place for b1, and tidying up the documentation and comments for b2.
Cheers, Nick. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>

I wouldn't mind having a little more breathing room. It's frustrating to miss the train, but these bugs are several decades old so I guess nothing terrible will happen if their fixes get delayed to 3.9. On Thu, May 30, 2019 at 4:23 PM Nick Coghlan <ncoghlan@gmail.com> wrote:
Hi folks,
The reference implementation for PEP 558 (my attempt to fix the interaction between tracing functions and closure variables) is currently segfaulting somewhere deep in the garbage collector, and I've found that there's an issue with the PyEval_GetLocals() API returning a borrowed reference that means I need to tweak the proposed C API a bit such that PyEval_GetLocals() returns the proxy at function scope, and we add a new PyEval_GetPyLocals() that matches the locals() builtin.
I don't *want* to postpone this to Python 3.9, but there turned out to be more remaining work than I thought there was to get this ready for inclusion in beta 1.
I'll try to get the C API design details sorted today, but the segfault is mystifying me, and prevents the option of putting the core implementation in place for b1, and tidying up the documentation and comments for b2.
Cheers, Nick. _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/njs%40pobox.com
-- Nathaniel J. Smith -- https://vorpus.org

On Fri., 31 May 2019, 6:34 pm Nathaniel Smith, <njs@pobox.com> wrote:
I wouldn't mind having a little more breathing room. It's frustrating to miss the train, but these bugs are several decades old so I guess nothing terrible will happen if their fixes get delayed to 3.9.
And I could put that extra time to good use, as starting to flesh out the proxy implementation showed that we're missing a lot of scaffolding to help make it easier to define new low level mapping types without duplicating a lot of code. I'll update the PEP headers accordingly. Cheers, Nick.

On 5/31/2019 6:20 AM, Nick Coghlan wrote:
On Fri., 31 May 2019, 6:34 pm Nathaniel Smith, <njs@pobox.com <mailto:njs@pobox.com>> wrote:
I wouldn't mind having a little more breathing room. It's frustrating to miss the train, but these bugs are several decades old so I guess nothing terrible will happen if their fixes get delayed to 3.9.
Agreed.
And I could put that extra time to good use, as starting to flesh out the proxy implementation showed that we're missing a lot of scaffolding to help make it easier to define new low level mapping types without duplicating a lot of code.
I'll update the PEP headers accordingly.
I believe some of your suggested doc change is true now, will remain true, and improves on the current locals entry. No PEP approval is needed for this much. -- Terry Jan Reedy
participants (4)
-
Guido van Rossum
-
Nathaniel Smith
-
Nick Coghlan
-
Terry Reedy