• Guido van Rossum's avatar
    Another extension to reduce(). It can return a 4- or 5-tuple now. · 25cb7dfb
    Guido van Rossum authored
    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.)
    25cb7dfb
pickle.py 47.3 KB