Greg Ewing wrote:

Travis Oliphant wrote:


I'm proposing to pickle the buffer object so that it unpickles as a string.


Wouldn't this mean you're only solving half the problem?
Unpickling a Numeric array this way would still use an
intermediate string.


Well, actually, unpickling in the new numeric uses the intermediate string as the memory (yes, I know it's not supposed to be "mutable", but without a mutable bytes object what else are you supposed to do?).

Thus, ideally we would have a mutable-bytes object with a separate pickle opcode. Without this, then we overuse the string object. But, since the string is only created by the pickle (and nobody else uses it, then what's the real harm).

So, in reality the previously-mentioned patch together with modificiations to Numeric's unpickling code actually solves the whole problem.

-Travis


_______________________________________________ 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

Reply via email to