Author Rosuav
Recipients Rosuav
Date 2013-10-21.16:30:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382373000.68.0.189461007664.issue19335@psf.upfronthosting.co.za>
In-reply-to
Content
IDLE tries to be helpful, but it errors on something that isn't yet an error. Pasting in this code works fine:

>>> def a():
	def b():
		nonlocal q
		q+=1
	q=1
	b()
	return q

>>> a()
2

But typing it, line by line, results in an error:

>>> def a():
	def b():
		nonlocal q
		
SyntaxError: no binding for nonlocal 'q' found

This doesn't occur with interactive command-line Python. A small issue, more of curiosity value than anything else - I don't have a non-trivial use-case where this causes problems.
History
Date User Action Args
2013-10-21 16:30:00Rosuavsetrecipients: + Rosuav
2013-10-21 16:30:00Rosuavsetmessageid: <1382373000.68.0.189461007664.issue19335@psf.upfronthosting.co.za>
2013-10-21 16:30:00Rosuavlinkissue19335 messages
2013-10-21 16:30:00Rosuavcreate