[Python-3000] simplifying methods (was: Re: Droping find/rfind?)

Jim Jewett jimjjewett at gmail.com
Fri Aug 25 18:41:27 CEST 2006

On 8/24/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Until a few moments ago, I didn't know that str.startswith()
> had any optional arguments

I just looked them up, and they turn out to just be syntactic sugar
for a slice.  (Even to the extent of handling omitted arguments as
None.)  The stop argument in particular is (almost) silly.

  s.startswith(prefix, start, stop) === s[start:stop].startswith(prefix)

Ignoring efficiency concerns, would dropping the optional arguments
and requiring an explicit slice be a valid Py3K simplification?


More information about the Python-3000 mailing list