[Python-ideas] str.rreplace

Chris Angelico rosuav at gmail.com
Fri Jan 24 21:48:36 CET 2014


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


More information about the Python-ideas mailing list