[NumPy-Tickets] [NumPy] #1886: ndarray.data not compatible between python 2.7 and 3.2 versions
NumPy Trac
numpy-tickets@scipy....
Wed Jun 29 08:27:52 CDT 2011
#1886: ndarray.data not compatible between python 2.7 and 3.2 versions
-------------------------------------------+--------------------------------
Reporter: axh | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: 1.5.1
Keywords: compatibility, design clarity |
-------------------------------------------+--------------------------------
I am running python 3.2 / 2.7.2 with the standards from Fedora 15
numpy.x86_64
1:1.5.1-1.fc15
python3-numpy-f2py.x86_64
1:1.5.1-1.fc15
Here is the issue:
with
i4 = np.ndarray([1],dtype=np.int32)
in 2,7 I have
type(i4.data)
<type 'buffer'>
len(i4.data[:])
4
so the buffer is byte-size
in 3.2 the data buffer comes in chunks of the size of the basic type
len(i4.data[0])
4
len(i4.data)
1
type(i4.data)
<class 'memoryview'>
It would be most desirable to switch this back to a mode that provides
byte-size buffer in the same way in both versions. Especially, it would
be good if the buffer type memory layout does not depend on the type of
objects it stores. It should be just a data buffer.
-Alexander
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1886>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list