Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type
Paul Rubin
http
Fri Aug 26 15:35:51 EDT 2005
"Terry Reedy" <tjreedy at udel.edu> writes:
> I agree in this sense: the use of any int as an error return is an
> unPythonic *nix-Cism, which I believe was copied therefrom. Str.find is
> redundant with the Pythonic exception-raising str.index and I think it
> should be removed in Py3.
I like having it available so you don't have to clutter your code with
try/except if the substring isn't there. But it should not return a
valid integer index.
More information about the Python-list
mailing list