[pypy-commit] pypy default: Found a way in CPython to have several empty string objects.

arigo pypy.commits at gmail.com
Mon Jun 13 15:28:37 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r85145:9417f63e9eff
Date: 2016-06-13 21:29 +0200
http://bitbucket.org/pypy/pypy/changeset/9417f63e9eff/

Log:	Found a way in CPython to have several empty string objects.

diff --git a/pypy/doc/cpython_differences.rst b/pypy/doc/cpython_differences.rst
--- a/pypy/doc/cpython_differences.rst
+++ b/pypy/doc/cpython_differences.rst
@@ -335,9 +335,8 @@
 ``tuple`` and ``frozenset`` rules were added in PyPy 5.4; before that, a
 test like ``if x is "?"`` or ``if x is ()`` could fail even if ``x`` was
 equal to ``"?"`` or ``()``.  The new behavior added in PyPy 5.4 is
-closer to CPython's, which caches precisely the empty
-string/unicode/tuple/frozenset, and (sometimes!) the single-character
-strings and unicodes.
+closer to CPython's, which caches precisely the empty tuple/frozenset,
+and (generally but not always) the strings and unicodes of length <= 1.
 
 Note that for floats there "``is``" only one object per "bit pattern"
 of the float.  So ``float('nan') is float('nan')`` is true on PyPy,


More information about the pypy-commit mailing list