[Python-3000] simplifying methods (was: Re: Droping find/rfind?) (original) (raw)
Jim Jewett jimjjewett at gmail.com
Fri Aug 25 18:41:27 CEST 2006
- Previous message: [Python-3000] long/int unification
- Next message: [Python-3000] simplifying methods (was: Re: Droping find/rfind?)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
-jJ
- Previous message: [Python-3000] long/int unification
- Next message: [Python-3000] simplifying methods (was: Re: Droping find/rfind?)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]