[Python-ideas] Deprecate str.find

Nick Coghlan ncoghlan at gmail.com
Sat Jul 16 18:04:26 CEST 2011


On Sun, Jul 17, 2011 at 1:35 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Nick Coghlan wrote:
>> However, this seemingly simple suggestion is complicated by the fact
>> that string methods do not currently accept keyword arguments and
>> index() already accepts two optional positional arguments (for
>> substring searching).
>
> Does this require a PEP or just someone to start working on it?  Getting
> str() to accept keyword arguments and adding missing to str.index() sounds
> like a nice project.

Shouldn't need a full PEP, but will likely need at least some
discussion on python-dev and some pre- and post-patch microbenchmarks
to assess the impact on the speed of string operations (since passing
and parsing keyword arguments for C functions *is* slower than only
using positional arguments).

Compared to making strings Unicode by default, though, it's a pretty
minor change :)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list