Collin Winter <collinwinter <at> google.com> writes: > > I don't think it's possible in general to remove any PUTs if the > pickle is being written to a file-like object.
Does cPickle bytecode have some kind of NOP instruction? You could keep track of which PUTs weren't necessary and zero them out at the end. It would be much cheaper than writing a whole other "optimized" stream. (of course it only works on a seekable stream :-)) Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com