2011/3/19 Yaşar Arabacı <yasar11...@gmail.com> > >>>a=5 > >>>b=5 > >>>a == b > True > >>>a is b > True > > My question is, why "a is b" is true. What I expected it to be is that, a > and b are different things with same value. > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor >
Oops. I misread your post. I (why I don't know) thought I saw a = 5, b = 4. a and b are names. Python has an integer of 5 from a = 5, so it just refers to that same object with b. -- Joel Goldstick
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor