[NumPy-Tickets] [NumPy] #2188: python3: regression for unique on dtype=object arrays with varying items types

NumPy Trac numpy-tickets@scipy....
Mon Jul 23 12:33:39 CDT 2012


#2188: python3: regression for unique on dtype=object arrays with varying items
types
------------------------+---------------------------------------------------
 Reporter:  yarikoptic  |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  numpy.core  |     Version:  1.6.1      
 Keywords:              |  
------------------------+---------------------------------------------------
 tested against current master (present in 1.6.2 as well):

 If with python2.x series it works ok, without puking:

 {{{
 $> python2.7 -c 'import numpy as np; print
 repr(repr(np.unique(np.array([1,2, None, "str"]))))'
 'array([None, 1, 2, str], dtype=object)'
 }}}

 NB I will report a bug on __repr__ here separately if not yet filed

 it fails with python3.x altogether:

 {{{
 $> python3.2 -c 'import numpy as np;
 print(repr(repr(np.unique(np.array([1,2,None, "str"])))))'
 Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "/usr/local/lib/python3.2/dist-packages/numpy/lib/arraysetops.py",
 line 194, in unique
     ar.sort()
 TypeError: unorderable types: int() > NoneType()
 }}}

 whenever IMHO it must operate correctly -- semantic of unique() action
 should not imply ability to sort the elements

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2188>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list