[Python-Dev] Checking that PEP 558 (defined semantics for locals()) handles assignment expressions (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Wed Jul 4 08:34:02 EDT 2018


With PEP 572's formal acceptance now expected to be just a matter of time, I'll limit any further personal expressions of opinion on the change and the process taken to achieve it to other venues :)

However, there's a design aspect I do need to address, which is to make sure that PEP 558 (my proposal to actually nail down an implementation independent specification for how we expect locals() to behave at runtime) accurately covers the way runtimes and debuggers are expected to behave when comprehensions and generator expressions are executed at different scopes.

My current view is that it's going to be OK to expose the differing behaviours at module and function scope directly:

I think that's an acceptable outcome, since it's a natural consequence of PEP 572 defining its comprehension and generator expression handling in terms of existing global and nonlocal scoping semantics.

Cheers, Nick.

-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia



More information about the Python-Dev mailing list