diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-05-14 21:57:18 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2008-05-14 21:57:18 (GMT) |
commit | c7db1d68882bad3d54988f2b008c9844275b6cb4 (patch) | |
tree | 28e0ba81c32ea93627851194bf09b35c661a7c42 /Lib | |
parent | 46c6f94c447fdd167a0608fb5e5e209d0cc5e570 (diff) | |
download | cpython-c7db1d68882bad3d54988f2b008c9844275b6cb4.zip cpython-c7db1d68882bad3d54988f2b008c9844275b6cb4.tar.gz cpython-c7db1d68882bad3d54988f2b008c9844275b6cb4.tar.bz2 |
Change Pickler._batch_appends() and Pickler._batch_setitems() to take
an iterable object, instead of an iterator.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/pickle.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index bf5c951..25ffd03 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -594,7 +594,7 @@ class Pickler: write(MARK + LIST) self.memoize(obj) - self._batch_appends(iter(obj)) + self._batch_appends(obj) dispatch[list] = save_list @@ -611,6 +611,7 @@ class Pickler: write(APPEND) return + items = iter(items) r = range(self._BATCHSIZE) while items is not None: tmp = [] @@ -641,7 +642,7 @@ class Pickler: write(MARK + DICT) self.memoize(obj) - self._batch_setitems(iter(obj.items())) + self._batch_setitems(obj.items()) dispatch[dict] = save_dict if PyStringMap is not None: @@ -659,6 +660,7 @@ class Pickler: write(SETITEM) return + items = iter(items) r = range(self._BATCHSIZE) while items is not None: tmp = [] |