[Python-ideas] str.rreplace

Serhiy Storchaka storchaka at gmail.com
Sat Jan 25 09:25:53 CET 2014


25.01.14 09:55, Georg Brandl написав(ла):
> There was also the suggestion on stackoverflow of
>
> 'x'.join('aaa'.rsplit('aa', 1))
>
> which might be faster and less colon-y, but is very good at covering up the
> real purpose of the code :)

Indeed, it is faster if you less part of string is replaced.

But the [::-1] variant looks more funny.




More information about the Python-ideas mailing list