Alan G Isaac wrote:
<div class="moz-text-flowed" style="font-family: -moz-fixed">On 6/25/2010 1:14 PM, Dave Angel wrote:
the default behavior of += is to assign a new object with the new value,
rather than changing the previous object.

a = []
temp = a
a += [2]
temp
[2]

Alan Isaac


I said "default", not "only" behavior. I suspect list provides an __iadd__ method to provide this ability. Integers do not, and therefore neither does the object the OP was asking about.

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

Reply via email to