why is bytearray treated so inefficiently by pickle?

Irmen de Jong irmen.NOSPAM at xs4all.nl
Wed Dec 7 03:13:25 EST 2011


On 6-12-2011 23:24, Terry Reedy wrote:
> On Nov 30, Irmen de Jong opened a tracker issue with a patch improve bytearray pickling.
> http://bugs.python.org/issue13503
> 
> Yesterday, Dec 5, Antoine Pitrou applied a revised fix.
> http://hg.python.org/cpython/rev/e2959a6a1440/
> The commit message:
> "Issue #13503: Use a more efficient reduction format for bytearrays with pickle protocol
>>= 3. The old reduction format is kept with older protocols in order to allow unpickling
> under Python 2."
> 

Sure, but this patch only improved the pickle behavior of the bytearray type for
protocol level 3. It didn't touch Python 2.x, nor the pickling of arrays (array.array),
let alone numpy arrays.

Irmen



More information about the Python-list mailing list