This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mbussonn
Recipients mbussonn
Date 2017-02-17.17:06:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1487351217.08.0.939746599909.issue29593@psf.upfronthosting.co.za>
In-reply-to
Content
Raymond Hettinger reported during PyCon Canada 2016 Keynote (~20m30 sec)
that unbound local error message was inaccurate, it state that :

> local variable 'xxx' referenced before assignment

Though it can be assigned and deleted.

    for a toy example:

       def foo():
          x = 1
          del x
          print(x)

       foo()

Do the same for free variable.

    def multiplier(n):
	def multiply(x):
	    return x * n
	del n
	return multiply

The error message can be improved by adding "or got deleted".
History
Date User Action Args
2017-02-17 17:06:57mbussonnsetrecipients: + mbussonn
2017-02-17 17:06:57mbussonnsetmessageid: <1487351217.08.0.939746599909.issue29593@psf.upfronthosting.co.za>
2017-02-17 17:06:57mbussonnlinkissue29593 messages
2017-02-17 17:06:56mbussonncreate