[Python-Dev] 2.5 and beyond (original) (raw)
Tim Peters tim.peters at gmail.com
Fri Jun 30 12:01:17 CEST 2006
- Previous message: [Python-Dev] 2.5 and beyond
- Next message: [Python-Dev] 2.5 and beyond
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Ka-Ping Yee, on http://www.python.org/dev/peps/pep-0356/ ]
Among them is this one:
Incorrect LOAD/STOREGLOBAL generation http://python.org/sf/1501934 The question is, what behaviour is preferable for this code: g = 1 def f(): g += 1 f() Should this raise an UnboundLocalError or should it increment g? (Or, in other words, should augmented assignment be considered a local binding like regular assignment, or not?)
Of course it should, since that's the way it is treated in all released Pythons, and there was no intent to change the semantics (let alone a FutureWarning in 2.4 to alert users that the meaning was going to change in 2.5). The Reference Manual also makes no distinction between assignment statements and augmented assignment statements in any relevant respect. The change in behavior here in 2.5 is plainly a bug (although someone may want to argue "it should" be different in P3K).
- Previous message: [Python-Dev] 2.5 and beyond
- Next message: [Python-Dev] 2.5 and beyond
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]