[Python-Dev] String methods... finally

Guido van Rossum guido at CNRI.Reston.VA.US
Fri Jun 11 15:58:10 CEST 1999


> > > Two new methods startswith and endswith act like their Java cousins.
> > 
> > is it just me, or do those method names suck?

It's just you.

> > begin?  starts_with?  startsWith? (ouch)
> > has_prefix?

Those are all painful to type, except "begin", which isn't expressive.

> In mxTextTools I used the names prefix() and suffix() for much

The problem with those is that it's arbitrary (==> harder to remember)
whether A.prefix(B) means that A is a prefix of B or that A has B for
a prefix.

--Guido van Rossum (home page: http://www.python.org/~guido/)





More information about the Python-Dev mailing list