[Python-checkins] cpython (merge 3.2 -> default): Minor text rearrangement.
raymond.hettinger
python-checkins at python.org
Wed Apr 20 22:10:05 CEST 2011
http://hg.python.org/cpython/rev/a4b93391fb7c
changeset: 69494:a4b93391fb7c
parent: 69491:97ad0da26a24
parent: 69493:235633dbbf9a
user: Raymond Hettinger <python at rcn.com>
date: Wed Apr 20 13:09:46 2011 -0700
summary:
Minor text rearrangement.
files:
Lib/collections/__init__.py | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -152,16 +152,6 @@
link.next = first
root.next = first.prev = link
- 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 __sizeof__(self):
sizeof = _sys.getsizeof
n = len(self) + 1 # number of links including root
@@ -202,6 +192,16 @@
return '%s()' % (self.__class__.__name__,)
return '%s(%r)' % (self.__class__.__name__, list(self.items()))
+ 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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list