[NumPy-Tickets] [NumPy] #354: Possible inconsistency in 0-dim and scalar empty array types

NumPy Trac numpy-tickets@scipy....
Wed Mar 30 10:21:34 CDT 2011


#354: Possible inconsistency in 0-dim and scalar empty array types
------------------------+---------------------------------------------------
 Reporter:  faltet      |       Owner:  somebody   
     Type:  defect      |      Status:  new        
 Priority:  normal      |   Milestone:  Unscheduled
Component:  numpy.core  |     Version:  devel      
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by bsouthey):

 This is an invalid ticket because an empty array is not the same thing as
 an empty numpy string. It is a similar comparison to comparing a Python
 list that has a single empty string to the actual empty string.

 First there is an ndarray there is an ndarray that just happens to consist
 of a single element that is an empty string (but the actual ndarray is not
 '''empty''')):
 {{{
 type(numpy.array("")) # <type 'numpy.ndarray'>
 }}}
 Second there is an element from that array that is an numpy string:
 {{{
 type(numpy.array("")[()]) # <type 'numpy.string_'>
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/354#comment:7>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list