I agree with Steven D'Aprano. I never had problems with strip(), but if people find it confusing, Python can simply leave strip() and all the other function as they are and add another functions, like crop() or snip() or shear() prune() or mow(). Personally I prefer crop() or prune().
This way there will be no breaking changes. On Sat, 7 Mar 2020 at 02:58, Ethan Furman <et...@stoneleaf.us> wrote: > > On 03/06/2020 04:03 PM, Steven D'Aprano wrote: > > On Thu, Mar 05, 2020 at 12:45:28PM -0800, Andrew Barnert via Python-ideas > > wrote: > > >> Well, I like the idea if someone can come up with a good naming > >> scheme—something that at least reminds me which function is the “set > >> of chars” stripper and which the “substring” stripper, > > > > You've been a Python programmer for how many years now? Do you currently > > have trouble remembering what lstrip and rstrip do? > > Speaking for myself, about 13 years. And, yes, I do occasionally forget that > the strips are character based. I can easily imagine it's worse for polyglot > programmers. > > > > We already have `[l|r]strip` methods. If we want to associate the new > > methods with those, I suggest > > > > strip_prefix > > strip_suffix > > Works for me. Easy to add to bytes, too, if somebody is so inclined. > > -- > ~Ethan~ > _______________________________________________ > Python-ideas mailing list -- python-id...@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-id...@python.org/message/JKBILM3G2C4TQ7XEVIH3V7M7CKCJ4R6Y/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- https://mail.python.org/mailman/listinfo/python-list