[pypy-issue] [issue835] Different behaviors of 'is' and '==' than cpython

Armin Rigo tracker at bugs.pypy.org
Fri Aug 19 01:34:09 CEST 2011

Armin Rigo <armin.rigo at gmail.com> added the comment:

Added to the doc:

+* Do not compare immutable objects with ``is``.  For example on CPython
+  it is true that ``x is 0`` works, i.e. does the same as ``type(x) is
+  int and x == 0``, but it is so by accident.  If you do instead
+  ``x is 1000``, then it stops working, because 1000 is too large and
+  doesn't come from the internal cache.  In PyPy it fails to work in
+  both cases, because we have no need for a cache at all.

nosy: +arigo

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list