[Python-ideas] Deprecate str.find

M.-A. Lemburg mal at egenix.com
Sat Jul 16 11:11:10 CEST 2011


Georg Brandl wrote:
> By the way: str.index() raises ValueError, not IndexError, if the substring
> isn't found.  That's one argument against "the index() API is foolproof,
> while the find() API isn't".

That's because the *value* passed as argument to .index() isn't
found. Which error class to use often depends on your view point,
so in some cases it may seem natural to you, in others you have
a different POV, and it feels wrong :-)

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jul 16 2011)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the Python-ideas mailing list