On 2/2/2012 9:17 AM, John O'Hagan wrote:

It's not so much about the type of x but that of x[1]. Wouldn't it be
possible to omit the assignment simply if the object referred to by
x[1] uses "+=" without creating a new object? That way, some_tuple[i]
+= y will succeed if some_tuple[i] is a list but not with, say, an
int. That seems reasonable to me.

There was considerable discussion of the exact semantics of augmented operations when they were introduced. I do not remember if that particular idea was suggested (and rejected) or not. You could try to look at the PEP, if there is one, or the dicussion ( probably on pydev list).

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to