There is a subtle point though.
If the substring is not found '_'.find(' '), will return -1
Semanticly, I was expecting the that if the substring was not found, the
conditional statement would not be found.
However, python evaluates -1 to True, so that is what I do find confusing.
So, I was arguing that '_'.find(' ') might return 0, however that is
obviously ambigious, since 0 might be an index as well.

So, perhaps I should rephrase and ask, why if -1 evaluates to True?
I think that's pretty ugly...

cheers,

-jelle
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to