]> granicus.if.org Git - python/commit
Another extension to reduce(). It can return a 4- or 5-tuple now.
authorGuido van Rossum <guido@python.org>
Fri, 31 Jan 2003 18:53:21 +0000 (18:53 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 31 Jan 2003 18:53:21 +0000 (18:53 +0000)
commit25cb7dfb0f0c32b51a813869f4ef3ab25cba5b2a
tree99e20403f50c402d21e36a5ad1f88d3bc3af9a33
parentf9b0cc7df6f5d0c9350edb4b587b851170fdeb18
Another extension to reduce().  It can return a 4- or 5-tuple now.
The 4th item can be None or an iterator yielding list items, which are
used to append() or extend() the object.  The 5th item can be None or
an iterator yielding a dict's (key, value) pairs, which are stuffed
into the object using __setitem__.

Also (as a separate, though related, feature) add "batching" for list
and dict items.  If you pickled a dict or list with a million items in
the past, it would push a million items onto the stack.  It now pushes
only 1000 items at a time on the stack, using repeated APPENDS or
SETITEMS opcodes.  (For lists, I hope that using many short extend()
calls doesn't exhibit quadratic behavior.)
Lib/pickle.py