Just the first occurrence. The vast majority of the time, that's what people want to do, and they will usually forget to add a 'count' parameter. Many people probably wouldn't even know it exists. It would be disastrous if code did the correct thing 99.9% of the time but occasionally silently mutilated a string.
On Wed, Mar 18, 2020 at 8:06 PM 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? > > [all modulo bikeshedding on the names of course] > > 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/GZ7KLN3DX3LTM3ZJ6T5B73CXBPZGHVOD/ Code of Conduct: http://python.org/psf/codeofconduct/
