Carl Banks wrote: >>> q = 0 > >>> r = 0 > >>> s = 0 > >>> id(q) > 134536636 > >>> id(r) > 134536636 > >>> id(s) > 134536636 >
> It is okay with constant object, really. No: >>> r=100001 >>> s=100001 >>> t=100001 >>> id(r) 135620508 >>> id(s) 135620532 >>> id(t) 135104688 It worked with the number 0 because of an implementation accident, in general Python can use different ids for constant objects that are equals in the == sense. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list