1. vinodm
  2. pypy


Lukas Diekmann  committed c854a2e

fixed test in lib-python/modified-2.7/test_weakref and adjusted cpython-differences documentation

  • Participants
  • Parent commits e108777
  • Branches dict-strategies

Comments (0)

Files changed (2)

File lib-python/modified-2.7/test/test_weakref.py

View file
  • Ignore whitespace
             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)
             self.assertTrue(v is value2)

File pypy/doc/cpython_differences.rst

View file
  • Ignore whitespace
   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