I haven't gotten to writing that into the PEP yet, but I think the rule has to be to take the scope of evaluation not the scope of definition. I know it needs to be there, and I'm just thinking about helpful examples.
Which is to say the semantics are more like `eval()` than like a lambda closure. ... and I know this is going to raise the neck hairs of many folks, because effectively I'm proposing a kind of dynamic scoping. Possibly in my defense, I think Carl's PEP 690 can do the same thing. :-) On Tue, Jun 21, 2022, 6:27 PM Chris Angelico > What are the scoping rules for deferred objects? Do they access names > where they are evaluated, or where they are defined? >
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ONBSI7GFDSGYEPMGHKA3OTY4S2VUPUJ4/ Code of Conduct: http://python.org/psf/codeofconduct/