> On 18 Mar 2020, at 18:03, Rob Cliffe via Python-ideas 
> <[email protected]> wrote:
> 
> Consider that the start or end of a string may contain repetitions of an 
> affix.
> 
> 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.
As Alex said 1 prefix is the common case. For the all case there are existing 
ways to do it.

If you are counting the number of prefix occurrences that exist you can simple 
slice the answer
without the strip prefix function.

Barry


> 
> [all modulo bikeshedding on the names of course]

A mauvey shade of purple.

> 
> Rob Cliffe
> 
> _______________________________________________
> 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/JMWBL7HILHKZ7JVN2JEH3K5NHQUVFVNZ/
> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
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/EBJXFP2UW4W4S47OKJ7UYILCZGUFNFSA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to