[Python-Dev] Discussion on adding rsplit() for strings and unicode objects.

Sean Reifschneider jafo-python-dev at tummy.com
Fri Sep 19 04:33:46 EDT 2003


A few weeks ago I submitted a patch to add an rsplit() method to
string and unicode objects:

>Adding rsplit() to string and unicode objects. (2003-09-06)
>	http://python.org/sf/801847

loewis responded with:
>[...] I feel that there are already too many string methods, so I
>won't accept that patch. I'm not rejecting it, either, because I see
>that other maintainers might have a different opinion. In short, you
>should propose your change to python-dev, finding out what "a majority"
>of the maintainers thinks [...]

My understanding of why the patch was not accepted is that users can
implement it themselves.

My reason for spending the time implementing the patch was that I
noticed it was missing in some coding I was doing.  Instead of having
this tool available, I had to interrupt the flow of my coding and build
and test an rsplit implementation.  Not a huge undertaking, of course,
but still something that had to be dealt with.

I guess at least some maintainers wish for string objects to have fewer
methods.  I haven't heard of any alternative location to place it other
than placing a Python implementation in the Cookbook.  That alternative
seems strange to me -- requiring a user locate and maintain an
alternative implementation in their own code, likely at a fairly big
performance penalty (my rsplit is an adaptation of the existing split()
C code).

Obviously, I felt this was enough of a lack in the library that I spent
most of a Sunday afternoon tracking down and implementing it.  One of
Python's strengths is it's rich standard library (he says after spending
a few hours unsuccessfully trying to package a dozen Perl modules), and
I'd like to see it get even better.

I'd like to open this discussion, as loewis suggests, to the python-dev
folks.  Thoughts?

Thanks,
Sean
-- 
 Money is the root of all evil!  Man needs roots...
Sean Reifschneider, Member of Technical Staff <jafo at tummy.com>
tummy.com, ltd. - Linux Consulting since 1995.  Qmail, Python, SysAdmin
      Back off man. I'm a scientist.   http://HackingSociety.org/



More information about the Python-Dev mailing list