[Numpy-tickets] [NumPy] #344: Normalize shapes in dtype representation
NumPy
numpy-tickets at scipy.net
Fri Oct 13 03:05:42 CDT 2006
#344: Normalize shapes in dtype representation
-------------------------+--------------------------------------------------
Reporter: faltet | Owner: somebody
Type: enhancement | Status: new
Priority: low | Milestone:
Component: Other | Version: devel
Severity: minor | Keywords:
-------------------------+--------------------------------------------------
It would be nice if shapes in repr(dtype) could be normalized to use
always tuples. For example:
{{{
In [63]:dt1=numpy.dtype(('uint32', 2))
In [64]:dt2=numpy.dtype(('uint32', (2,)))
In [65]:dt1 == dt2
Out[65]:True
In [66]:dt1.shape
Out[66]:(2,)
In [67]:dt2.shape
Out[67]:(2,)
# But....
In [68]:dt1
Out[68]:dtype(('uint32',2))
In [69]:dt2
Out[69]:dtype(('uint32',(2,)))
}}}
for an inexpert user, repr of dt1 and dt2 may lead him to think that they
are different dtypes and they are not.
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/344>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list