shouldn't 'string'.find('ugh') return 0, not -1 ?
martin at marcher.name
Wed Oct 31 15:21:59 CET 2007
2007/10/31, jelle <jelleferinga at gmail.com>:
> the subject pretty much says it all.
> if I check a string for for a substring, and this substring isn't found,
> should't the .find method return 0 rather than -1?
> this breaks the
IMHO "0" would mean the substring starts at index 0 of the iterable.
If that changes it should return "None" in python instead of a int anyway, no?
More information about the Python-list