> 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).
>

That’s why I said earlier that this is not technically a SyntaxError.

Would it be possible to raise a UnboundLocalError at function definition
time if any deferred parameters refer to any others.

Functionality similar to a SyntaxError, but more in line with present
behavior.

-CHB

>
> --
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
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/VYTQLFB4OLQI52UE64ZP5MXRAWCANDMY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to