[Python-checkins] cpython (2.7): Use a generic class lookup.

raymond.hettinger python-checkins at python.org
Tue Apr 19 18:55:00 CEST 2011


http://hg.python.org/cpython/rev/f3088be1b20d
changeset:   69442:f3088be1b20d
branch:      2.7
user:        Raymond Hettinger <python at rcn.com>
date:        Tue Apr 19 09:52:21 2011 -0700
summary:
  Use a generic class lookup.

files:
  Lib/collections.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/collections.py b/Lib/collections.py
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -116,7 +116,7 @@
         'Return state information for pickling'
         items = [[k, self[k]] for k in self]
         inst_dict = vars(self).copy()
-        for k in vars(OrderedDict()):
+        for k in vars(self.__class__()):
             inst_dict.pop(k, None)
         if inst_dict:
             return (self.__class__, (items,), inst_dict)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list