On Sun, Oct 24, 2021, 12:20 AM Chris Angelico > How would it know to look for a and b inside fn2's scope, instead of > looking for x inside fn2's scope? >
The same way 'eval("a+b")' knows to look in the local scope when evaluated. I mean, of course 'x' could be rebound in some scope before it was evaluated. But a "deferred" object itself would simply represent potential computation that may or may not be performed. If we wanted to use descriptors, and e.g. use 'x.val' rather than plain 'x' , we could do it now with descriptors. But not with plain variable names now.
_______________________________________________ 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/VAORMIMN7LKBRQ2CSHV732MT7QRYQ2SU/ Code of Conduct: http://python.org/psf/codeofconduct/