On Wed, Oct 13, 2021, 11:01 AM Stephen J. Turnbull <
[email protected]> wrote:

Chris Angelico writes:

 > +1, although it's debatable whether it should be remove suffix or
 > remove all. I'd be happy with either.

If by "remove all" you mean "efefef" - "ef" == "", I think that's a
footgun.  Similarly for "efabcd" - "ef" == "abcdef" - "ef".

Steve


Maybe it should be "remove the first one" rather than a suffix.

Then for removal of multiple substrings, you could allow the RHS to be a
sequence of substrings:

>>> "efaxefef" - "ef"
"axefef"
>>> "efaxefef" - ["ef", "ax"]
"efef"
>>> "efaxefef" - ["ef"]*3
"ax"

BTW these are interesting ideas and I'm just exploring the possibilities.
Not proposing or agreeing with anything.
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/E3OWMUU7C2P2WT53PYWDMVWNKHCZR7WF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to