[pypy-commit] pypy dict-strategies: fixed test in lib-python/modified-2.7/test_weakref and adjusted cpython-differences documentation
l.diekmann
noreply at buildbot.pypy.org
Wed Jun 8 16:50:31 CEST 2011
Author: Lukas Diekmann <lukas.diekmann at uni-duesseldorf.de>
Branch: dict-strategies
Changeset: r44833:c854a2e4ea5f
Date: 2011-06-08 16:51 +0200
http://bitbucket.org/pypy/pypy/changeset/c854a2e4ea5f/
Log: fixed test in lib-python/modified-2.7/test_weakref and adjusted
cpython-differences documentation
diff --git a/lib-python/modified-2.7/test/test_weakref.py b/lib-python/modified-2.7/test/test_weakref.py
--- a/lib-python/modified-2.7/test/test_weakref.py
+++ b/lib-python/modified-2.7/test/test_weakref.py
@@ -999,7 +999,7 @@
self.assertTrue(v is value2)
k, v = weakdict.popitem()
self.assertTrue(len(weakdict) == 0)
- if k is key1:
+ if k == key1:
self.assertTrue(v is value1)
else:
self.assertTrue(v is value2)
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
@@ -248,5 +248,7 @@
never a dictionary as it sometimes is in CPython. Assigning to
``__builtins__`` has no effect.
+* object identity of immutable keys in dictionaries is not necessarily preserved.
+ Never compare immutable objects with ``is``.
+
.. include:: _ref.txt
-
More information about the pypy-commit
mailing list