On Sun, 22 Mar 2020 at 17:58, Guido van Rossum <gu...@python.org> wrote:
>
> On Sun, Mar 22, 2020 at 9:54 AM Christopher Barker <python...@gmail.com> 
> wrote:
>>
>> On Sun, Mar 22, 2020 at 2:08 AM Barry Scott <ba...@barrys-emacs.org> wrote:
>>>
>>> >>> Should `-+-+-+Spam'.stripprefix('-+')  remove just the first occurence? 
>>> >>>  All of them?  Does it need a 'count' parameter?
>>> >> The only ways to use this function without counting is remove 1 prefix 
>>> >> or remove all.
>
>
> Please, please. removeprefix/removesuffix do not need a count. The use case 
> is quite different from that of replace. And they should only remove (at 
> most) one prefix or suffix.

+1 from me. These should be simple functions to remove a prefix/suffix
(note "a prefix" = "one prefix"). Let's not over-engineer them.

I've needed to remove one prefix/suffix. I've never needed to remove
more than one.
Paul
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/PCXX2E77MJTXKMTZDNUMMRV6BMZMUY3N/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to