A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-April/034510.html below:

[Python-Dev] backporting string changes to 2.2.3

[Python-Dev] backporting string changes to 2.2.3Boris Boutillier boris.boutillier@arteris.net
11 Apr 2003 17:04:45 +0200
I see, I didn't think about all the documentations to update, and i
should have as I've got the same problem in my project :).

> I think the reason is that there isn't enough need for it.  The
> special case of s.rsplit(c, 1) can be coded so easily by using rfind()
> that I don't see the need to add it.  Our Swiss Army Knife string type
> is beginning to be so loaded with features that I am reluctant to add
> more.  The cost of a new feature these days is measured in the number
> of books that need to be updated, not the number of lines of code
> needed to implement it.
> 
> For your amusement only (! :-), I offer this implementation of
> rsplit(), which works in Python 2.3:
> 
> def rsplit(string, sep, count=-1):
>     L = [part[::-1] for part in string[::-1].split(sep[::-1], count)]
>     L.reverse()
>     return L
Didn't thought about this one, tricky and amusing.

-- 
Boris Boutillier - Boris.Boutillier@arteris.net




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4