Can't match str/unicode

Chris Angelico rosuav at
Sat Jan 7 18:42:06 EST 2017

On Sun, Jan 8, 2017 at 8:40 AM, CM <cmpython at> wrote:
> This is candidate_text: match
> <type 'str'>
> <type 'str'>
> False
> and, of course, doesn't enter that "do something" loop since apparently candidate_text != 'match'...even though it seems like it does.
> So what's going on here? Why isn't a string with the content 'match' equal to another string with the content 'match'?

What happens if you print the repr of each string? Or, if one of them
truly is a literal, just print the repr of the one you got from


More information about the Python-list mailing list