Commit c57a3cb8 authored by Raymond Hettinger's avatar Raymond Hettinger

Minor text rearrangement.

parent 15cad7df
......@@ -98,16 +98,6 @@ class OrderedDict(dict):
yield curr.key
curr = curr.prev
def __reduce__(self):
'Return state information for pickling'
items = [[k, self[k]] for k in self]
inst_dict = vars(self).copy()
for k in vars(OrderedDict()):
inst_dict.pop(k, None)
if inst_dict:
return (self.__class__, (items,), inst_dict)
return self.__class__, (items,)
update = __update = MutableMapping.update
keys = MutableMapping.keys
values = MutableMapping.values
......@@ -156,6 +146,16 @@ class OrderedDict(dict):
self.__in_repr = False
return result
def __reduce__(self):
'Return state information for pickling'
items = [[k, self[k]] for k in self]
inst_dict = vars(self).copy()
for k in vars(OrderedDict()):
inst_dict.pop(k, None)
if inst_dict:
return (self.__class__, (items,), inst_dict)
return self.__class__, (items,)
def copy(self):
'od.copy() -> a shallow copy of od'
return self.__class__(self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment