
On Sun, Mar 22, 2020 at 06:57:52AM +0300, Ivan Pozdeev via Python-Dev wrote:
Does it need to be separate methods?
Yes. Overloading a single method to do two dissimilar things is poor design.
As written in the PEP preface, the very reason for the PEP is that people are continuously trying to use *strip methods for the suggested functionality -- which shows that this is where they are expecting to find it.
They are only expecting to find it in strip() because there is no other alternative where it could be. There's nothing inherent about strip that means to delete a prefix or suffix, but when the only other choices are such obviously wrong methods as upper(), find(), replace(), count() etc it is easy to jump to the wrong conclusion that strip does what is wanted. -- Steven