Tim Peters <tim.pet...@gmail.com> added the comment: "is" is for testing object identity, not numeric equality. That "1 is 1" is always true is simply an implementation detail common to all recent versions of CPython, due to CPython caching "very small" integer objects. The language definition neither requires nor forbids this, so any program relying on it is in error. Likewise any program relying on "1.0 is 1.0" being false is also in error.
---------- nosy: +tim_one _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4638> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com