Skip to content

Strings with leading nulls don't compare properly (Trac #476) #1074

@numpy-gitbot

Description

@numpy-gitbot

Original ticket http://projects.scipy.org/numpy/ticket/476 on 2007-03-24 by trac user kreymborg, assigned to unknown.

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]]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions