shouldn't 'string'.find('ugh') return 0, not -1 ?
- From: jelle <jelleferinga@xxxxxxxxx>
- Date: Wed, 31 Oct 2007 13:31:06 +0000 (UTC)
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
if check.find('something'):
do(somethingElse)
idiom, which is a bit of a pity I think.
cheers,
-jelle
.
- Follow-Ups:
- Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- From: Carl Banks
- Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- From: Marc 'BlackJack' Rintsch
- Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- From: Hrvoje Niksic
- Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- Prev by Date: Re: marshal vs pickle
- Next by Date: Re: A Python 3000 Question
- Previous by thread: py2exe (or other exe builder) on Vista system for Vista/XP install targets.
- Next by thread: Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- Index(es):
Relevant Pages
|