[issue7329] global statements outside functions/methods should raise SyntaxError

2009-11-21 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I concur. -- nosy: +rhettinger resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7329

[issue7329] global statements outside functions/methods should raise SyntaxError

2009-11-20 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I once proposed this change, but became less supportive as I can to appreciate have fewer rather than more special-case rules. With Gabriel's explanation, I now oppose the idea and think this should be closed. -- nosy: +tjreedy

[issue7329] global statements outside functions/methods should raise SyntaxError

2009-11-16 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: The compiler doesn't know how the code is going to be used apart from the mode parameter: py c=compile(x=1,,exec) py import dis py dis.dis(c) 1 0 LOAD_CONST 0 (1) 3 STORE_NAME 0

[issue7329] global statements outside functions/methods should raise SyntaxError

2009-11-15 Thread Ezio Melotti
New submission from Ezio Melotti ezio.melo...@gmail.com: 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

[issue7329] global statements outside functions/methods should raise SyntaxError

2009-11-15 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Please bring this up on Python-dev if you'd like to change it. The fact that there's a test verifying that this can happen suggests there is some reason. -- ___ Python tracker