Author: Alex Gaynor <[email protected]>
Branch: 
Changeset: r45444:4127e61bd4bc
Date: 2011-07-09 16:38 -0700
http://bitbucket.org/pypy/pypy/changeset/4127e61bd4bc/

Log:    When inserting an item in the memodict (so it starts counting at 1)
        insert the id of None, rather than None itself, this way it stays an
        int-specialized dict.

diff --git a/lib_pypy/cPickle.py b/lib_pypy/cPickle.py
--- a/lib_pypy/cPickle.py
+++ b/lib_pypy/cPickle.py
@@ -27,9 +27,9 @@
             PythonPickler.__init__(self, self.__f, args[0], **kw)
         else:
             PythonPickler.__init__(self, *args, **kw)
-            
+
     def memoize(self, obj):
-        self.memo[None] = None   # cPickle starts counting at one
+        self.memo[id(None)] = None   # cPickle starts counting at one
         return PythonPickler.memoize(self, obj)
 
     def getvalue(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to