Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

Antoon Pardon apardon at forel.vub.ac.be
Mon Aug 29 04:32:03 EDT 2005


Op 2005-08-27, Terry Reedy schreef <tjreedy at udel.edu>:
>
> "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message 
> news:7xslwwjsft.fsf at ruckus.brouhaha.com...
>> "Terry Reedy" <tjreedy at udel.edu> writes:
>>> The try/except pattern is a pretty basic part of Python's design.  One
>>> could say the same about clutter for *every* function or method that 
>>> raises
>>> an exception on invalid input.  Should more or even all be duplicated? 
>>> Why
>>> just this one?
>>
>> Someone must have thought str.find was worth having, or else it
>> wouldn't be in the library.
>
> Well, Guido no longer thinks it worth having and emphatically agreed that 
> it should be added to one of the 'To be removed' sections of PEP 3000.

I think a properly implented find is better than an index.

If we only have index, Then asking for permission is no longer a
possibility. If we have a find that returns None, we can either
ask permission before we index or be forgiven by the exception
that is raised.

-- 
Antoon Pardon



More information about the Python-list mailing list