On Wed, Jun 13, 2018 at 3:54 PM MRAB <[email protected]> wrote:
> Would it check first-to-last or longest-to-shortest? I think that
> longest-to-shortest would be the most useful.
>
> >>> old = ('cat', 'cats')
> >>> new = ('mouse', 'mice')
> >>>
> >>> # First-to-last.
> >>> 'cats'.replace(old, new)
> 'mouses'
> >>>
> >>> # Longest-to-shortest.
> >>> 'cats'.replace(old, new)
> 'mice'
>
I would expect left-to-right, and leave the programmer to get their mouse
in order.
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/