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 ezio.melotti
Recipients benjamin.peterson, ezio.melotti
Date 2009-11-15.15:10:23
SpamBayes Score 0.00047467212
Marked as misclassified No
Message-id <1258297827.42.0.98275960381.issue7329@psf.upfronthosting.co.za>
In-reply-to
Content
Python currently accepts global statements at the top level:
>>> global foo
>>>

Beside being a meaningless operation, this might lead unexperienced user
to make mistakes like:
>>> foo = 5
>>> global foo # make foo global
>>> def func():
...   print foo # access the global foo
...
>>> func()
5
>>> # it works!

"global foo" should raise a SyntaxError, similarly to what already
happens with "return":
>>> return foo
  File "<stdin>", line 1
SyntaxError: 'return' outside function
History
Date User Action Args
2009-11-15 15:10:31ezio.melottisetrecipients: + ezio.melotti, benjamin.peterson
2009-11-15 15:10:27ezio.melottisetmessageid: <1258297827.42.0.98275960381.issue7329@psf.upfronthosting.co.za>
2009-11-15 15:10:25ezio.melottilinkissue7329 messages
2009-11-15 15:10:24ezio.melotticreate
X