On Sun, 22 Mar 2020 at 17:58, Guido van Rossum <[email protected]> wrote:
>
> On Sun, Mar 22, 2020 at 9:54 AM Christopher Barker <[email protected]> 
> wrote:
>>
>> On Sun, Mar 22, 2020 at 2:08 AM Barry Scott <[email protected]> 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 -- [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/PCXX2E77MJTXKMTZDNUMMRV6BMZMUY3N/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to