[Python-ideas] Revisiting str.rreplace()

Eric Fahlgren ericfahlgren at gmail.com
Thu Jul 19 10:06:22 EDT 2018


On Thu, Jul 19, 2018 at 7:01 AM Calvin Spealman <cspealma at redhat.com> wrote:

> As an alternative suggestion: What if the count parameter to str.replace()
> counted from the right with negative values? That would be consistent with
> other things like indexing and slicing.
>

​That could certainly be made to work, but I think it fails the
discoverability test.  You'd have the [:]-syntax and replace working one
way, and split/rsplit, find/rfind and so on working another way.  Unless
you're proposing the negative index for the latter ones also?​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180719/195dda87/attachment.html>


More information about the Python-ideas mailing list