Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type
Terry Reedy
tjreedy at udel.edu
Fri Aug 26 15:28:29 EDT 2005
"Bryan Olson" <fakeaddress at nowhere.org> wrote in message
news:7sJPe.573$MN5.131 at newssvr25.news.prodigy.net...
> The double-meaning of -1, as both an exclusive stopping bound
> and an alias for the highest valid index, is just plain whacked.
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.
Therefore, I think changing it now is untimely and changing the language
because of it backwards.
Terry J. Reedy
More information about the Python-list
mailing list