[Numpy-tickets] [NumPy] #476: Strings with leading nulls don't compare properly

NumPy numpy-tickets@scipy....
Sat Mar 24 04:42:07 CDT 2007


#476: Strings with leading nulls don't compare properly
-----------------------+----------------------------------------------------
 Reporter:  kreymborg  |       Owner:  somebody
     Type:  defect     |      Status:  new     
 Priority:  normal     |   Milestone:          
Component:  Other      |     Version:          
 Severity:  normal     |    Keywords:          
-----------------------+----------------------------------------------------
 Comparison of equal-length numpy strings appears to cease at the first
 null character.    I used MSVC 7.1 compiler on 1.0.2.dev3593.  Example:

 s1 = "\000\001"[[BR]]
 s2 = "\000\002"[[BR]]
 print s1 == s2  # this evaluates as True[[BR]]
 print array(s1) == array(s2) # this evaluates as False[[BR]]

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/476>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list