best way to increment an IntVar?

Alan G Isaac alan.isaac at gmail.com
Fri Jun 25 16:46:14 EDT 2010


On 6/25/2010 3:52 PM, Dave Angel wrote:
> 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.


I have no idea what "default behavior" is supposed to mean.
Mutable objects like a list will generally modify in place.
Immutable objects of course will not.  An IntVar is mutable.
You have given no reason for it not to handle ``+=`` in an
unsurprising fashion.  It is not an int.

Alan Isaac




More information about the Python-list mailing list