On Mon, Oct 25, 2021 at 10:28 AM Chris Angelico <ros...@gmail.com> wrote:
> [...] The two options on the table are: > > 1) Allow references to any value that has been provided in any way > 2) Allow references only to parameters to the left > > Option 2 is a simple SyntaxError on compilation (you won't even get as > far as the def statement). Option 1 allows everything all up to the > point where you call it, but then might raise UnboundLocalError if you > refer to something that wasn't passed. > Note that if you were to choose the SyntaxError option, you'd be breaking new ground. Everywhere else in Python, undefined names are runtime errors (NameError or UnboundLocalError). -- --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-change-the-world/>
_______________________________________________ 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/JXHIOW7A6SZONPCAFFRCDZD2C5VIMVCK/ Code of Conduct: http://python.org/psf/codeofconduct/