[Python-ideas] str.rreplace

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Jan 24 22:01:12 CET 2014


On 24/01/2014 20:48, Chris Angelico wrote:
> On Sat, Jan 25, 2014 at 7:33 AM,  <random832 at fastmail.us> wrote:
>>>>> 'aaa'[::-1].replace('aa'[::-1],'x'[::-1])[::-1]
>> 'ax'
>
> It makes me happy when the [::-1] smiley gets used that many times to
> solve a problem. Very happy.
>
> Happy that it isn't in _my_ code, to be precise...
>
> ChrisA

+1

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence



More information about the Python-ideas mailing list