On 05/10/2014 12:22 PM, MRAB wrote:
UnboundLocalError is like NameError, except that Python knows that the name is local because somewhere in the function you're binding to that name and you haven't said that it's global or nonlocal. Having a different exception for that case makes it clearer to the user what the problem is.
Absolutely. At one point NameError was raised in both cases, which could be very confusing to track down. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list