[NumPy-Tickets] [NumPy] #1809: Memmap with multiprocessing in Windows

NumPy Trac numpy-tickets@scipy....
Thu Apr 28 16:17:58 CDT 2011

#1809: Memmap with multiprocessing in Windows
 Reporter:  tfmoraes         |       Owner:  somebody   
     Type:  defect           |      Status:  new        
 Priority:  normal           |   Milestone:  Unscheduled
Component:  numpy.core       |     Version:  1.5.1      
 Keywords:  memmap, windows  |  

Comment(by rgommers):

 From the ML (cgohlke):
 I don't think this was working correctly in numpy 1.4 either. The
 underlying problem seems to be that instance attributes of ndarray
 subtypes get lost during pickling:

 import pickle
 import numpy as np
 class aarray(np.ndarray):
     def __new__(subtype):
         self = np.ndarray.__new__(subtype, (1,))
         self.attr = 'attr'
         return self
     def __array_finalize__(self, obj):
         self.attr = getattr(obj, 'attr', None)
 a = aarray()
 b = pickle.loads(a.dumps())
 assert a.attr == b.attr, (a.attr, b.attr)

 AssertionError: ('attr', None)

Ticket URL: <http://projects.scipy.org/numpy/ticket/1809#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project

More information about the NumPy-Tickets mailing list