Magnus Lycka wrote: > In some cases, "==" and "is" happens to give the same result. > >>> a = 1 > >>> b = 1 > >>> a == b > 1 > >>> a is b > 1 > > But often not. > > >>> c = 123456789 > >>> d = 123456789 > >>> c == d > 1 > >>> c is d > 0 > ... > First of all, a lot of Python values except 1 (a.k.a. True) > are logically true in a Python expression....
Actually, True and 1 are interesting examples. >>> a, b = 1, True >>> a == b True >>> a is b False I suspect you simply forgot this fact. --Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list