[Python-Dev] Proof of the pudding: str.partition()

Charles Cazabon python at discworld.dyndns.org
Wed Aug 31 16:30:46 CEST 2005

Michael Chermside <mcherm at mcherm.com> wrote:
>    (*) An rpartition() function that searches from the right
> ...except that I understand why he included it and am convinced
> by the arguments (use cases can be demonstrated and people would
> expect it to be there and complain if it weren't).

I would think that perhaps an optional second argument to the method that
controls whether it searches from the start (default) or end of the string
might be nicer than having two separate methods, even though that would lose
parallelism with the current .find/.index.

While I'm at it, why not propose that for py3k that
.rfind/.rindex/.rjust/.rsplit disappear, and .find/.index/.just/.split grow an
optional "fromright" (or equivalent) optional keyword argument?

Charles Cazabon                           <python at discworld.dyndns.org>
GPL'ed software available at:               http://pyropus.ca/software/

More information about the Python-Dev mailing list