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 _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/UUH2K5SU6DIWJZCJP34IPFM6UWH7F376/ Code of Conduct: http://python.org/psf/codeofconduct/