[Python-Dev] Fwd: Problem withthe API for str.rpartition()
Fred L. Drake, Jr.
fdrake at acm.org
Tue Sep 5 20:10:33 CEST 2006
On Tuesday 05 September 2006 14:02, Jim Jewett wrote:
> Then shouldn't rpartition be S.rpartition(sep) -> (rest, sep, tail)
Whichever matches reality, sure. I've lost track of the rpartition() result
> Another possibility is data (for head/tail) and unparsed (for rest).
> S.partition(sep) -> (data, sep, unparsed)
> S.rpartition(sep) -> (unparsed, sep, data)
It's all data, so I think that's too contrived.
> I'm not sure which is worse --
> (1) distinguishing between tail and rest
> (2) using (overly generic) jargon like unparsed and data.
I don't see the distinction between tail and rest as problematic. But I've
not used lisp for a long time.
> Whatever the final decision, it would probably be best to add an
> example to the docstring. "a.b.c".rpartition(".") -> ("a.b", ".",
Fred L. Drake, Jr. <fdrake at acm.org>
More information about the Python-Dev