13 Jun
2010
13 Jun
'10
12:49 a.m.
Georg Brandl wrote:
Yes, but why does that make the current semantics broken?
The current semantics perversely make certain code useless that would otherwise have an obvious and useful interpretation. Maybe "suboptimal" would be a better adjective.
Am 12.06.2010 21:40, schrieb Bruce Frederiksen:
def foo(): # without an assignment to 'a', this is currently always an error! # it can only make sense if 'a' is global! a += 7
If you can't do that, then this is a bug!
Yes, it is a bug -- a bug in your code.
But if the programmer intended a to be global, the *only* reason it's a bug is the current somewhat arbitrary interpretation placed on the augmented assignment. -- Greg