[Python-Dev] pickling of large arrays

Martin v. Loewis martin@v.loewis.de
30 Jul 2002 00:46:03 +0200


"Ralf W. Grosse-Kunstleve" <rwgk@yahoo.com> writes:

> We are using Boost.Python to expose reference-counted C++ container
> types (similar to std::vector<>) to Python. E.g.:
> 
> from arraytbx import shared
> d = shared.double(1000000) # double array with a million elements
> c = shared.complex_double(100) # std::complex<double> array
> # and many more types, incl. several custom C++ types

I recommend to implement pickling differently, e.g. by returning a
byte string with the underlying memory representation. If producing a
duplicate is still not acceptable, I recommend to inherit from the
Pickler class.

Regards,
Martin