[Python-ideas] Revisiting str.rreplace()

Calvin Spealman cspealma at redhat.com
Thu Jul 19 10:09:41 EDT 2018


It would be consistent to apply it to other functions and I'd be in favour
of that, yes.

On Thu, Jul 19, 2018 at 10:06 AM, Eric Fahlgren <ericfahlgren at gmail.com>
wrote:

> 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/03ef0375/attachment.html>


More information about the Python-ideas mailing list