[Numpy-discussion] Deserialization uncouples shared arrays

Hrvoje Niksic hrvoje.niksic at avl.com
Tue Sep 22 07:14:55 EDT 2009


Hans Meine wrote:
> On Tuesday 22 September 2009 11:01:37 Hrvoje Niksic wrote:
>> Is it intended for deserialization to uncouple arrays that share a
>> common base?
> 
> I think it's not really intended, but it's a limitation by design.

I wonder why a "base" attribute is even restored, then?  If there is no 
care to restore the shared views, then views could simply be serialized 
as arrays?

> AFAIK, it's related to Luca Citi's recent "ultimate base" thread - you simply 
> cannot ensure serialization of arbitrary ndarrays in this way, because they 
> may point to *any* memory, not necessarily an ndarray-allocated one.

That's true in general.  I wonder if it's possible to restore shared 
arrays if (by virtue of "base" attribute) we know that the ndarray 
shares the memory of another ndarray.



More information about the NumPy-Discussion mailing list