"Bulba!" wrote: > Surely the variable i is a mutable object?
nope. > OK, again: > >>>> def t(a,i=[0]): > ... i[0]=i[0]+1 > ... return (a, i) > ... >>>> t(1) > (1, [1]) >>>> t(3) > (3, [2]) >>>> t(5) > (5, [3]) > > Yes, it works with the list. But why sharing value between calls > pertains some mutable objects and not the other mutable objects? a variable is not an object. reset your brain, and read this: http://www.effbot.org/zone/python-objects.htm or the longer version: http://starship.python.net/crew/mwh/hacks/objectthink.html </F> -- http://mail.python.org/mailman/listinfo/python-list