Dennis Lee Bieber a écrit :
(snip - about Tkinter IntVar type)

        It is NOT a numeric "variable" in Python realms.

        So var+=increment can't be used because Python would rebind the name
var to a new object -- but Tkinter would still be hooked to the original
object and never see the change.

>>> foo = []
>>> bar = foo
>>> foo += [1]
>>> foo
[1]
>>> bar
[1]
>>> bar is foo
True
>>> foo.__iadd__([2])
[1, 2]
>>> _ is foo
True
>>>

IOW : __iadd__ doesn't necessarily returns a new object !-)



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

Reply via email to