Hi,
Does anyone know if arrays would be picklable in python 2.4? Until
then, I tried to derive from array.array and add __setstate__ and
__getstate__ with the following code, but it seems I'm not doing it
correctly. Any idea what I'm doing wrong?
Thx and Regards,
Nicolas
import array as arr
class array(arr.array ):
def __getstate__(se lf):
return {'buffer': self.tostring() }
def __setstate__(se lf, dict):
self.fromstring (dict['buffer'])
Does anyone know if arrays would be picklable in python 2.4? Until
then, I tried to derive from array.array and add __setstate__ and
__getstate__ with the following code, but it seems I'm not doing it
correctly. Any idea what I'm doing wrong?
Thx and Regards,
Nicolas
import array as arr
class array(arr.array ):
def __getstate__(se lf):
return {'buffer': self.tostring() }
def __setstate__(se lf, dict):
self.fromstring (dict['buffer'])
Comment