[Numpy-discussion] numarray: Bug printing an object array after unpickling it

Edward C. Jones edcjones at comcast.net
Tue Jul 5 11:47:29 CDT 2005


#! /usr/bin/env python

# I have a PC with up-to-date Debian unstable Linux. I have installed
# Python 2.4.1 and numarray 1.3.2 from source (not from a Debian
# package). The following program fails for both pickle and cPickle:

import pickle
import numarray, numarray.objects
obj = numarray.objects.array([0,0,0,0], (2,2))
print obj

s = pickle.dumps(obj, pickle.HIGHEST_PROTOCOL)
open('mess2', 'w').write(s)

s = open('mess2', 'r').read()
obj = pickle.loads(s)
print obj  # Fails here




More information about the Numpy-discussion mailing list