[Python-ideas] str.rreplace

Antoine Pitrou solipsis at pitrou.net
Fri Jan 24 19:20:21 CET 2014


On Fri, 24 Jan 2014 20:13:26 +0200
Serhiy Storchaka <storchaka at gmail.com>
wrote:
> 24.01.14 19:36, Antoine Pitrou написав(ла):
> > On Fri, 24 Jan 2014 19:30:00 +0200
> > Serhiy Storchaka <storchaka at gmail.com>
> > wrote:
> >> 24.01.14 18:56, Antoine Pitrou написав(ла):
> >>> On Fri, 24 Jan 2014 08:47:14 -0800 (PST)
> >>> Ram Rachum <ram.rachum at gmail.com> wrote:
> >>>> I propose implementing str.rreplace. (It'll be to str.replace what
> >>>> str.rsplit is to str.split.)
> >>>
> >>> I suppose it only differs when the count parameter is supplied?
> >>>
> >>> I don't think it can hurt, except for the funny looks of its name.
> >>> In any case, if str.rreplace is added then so should bytes.rreplace and
> >>> bytearray.rreplace.
> >>
> >> bytearray.rremove, tuple.rindex, list.rindex, list.rremove.
> >
> > Not sure what those have to do with rreplace(). Overgeneralization
> > doesn't help.
> 
> If open a door for rreplace, it would be not easy to close it for rindex 
> and rremove.

Perhaps you underestimate our collective door closing skills ;)

Regards

Antoine.




More information about the Python-ideas mailing list