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 
order.  --sigh--

 > 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", ".",
 > "c")

Agreed.


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to