On 07Mar2020 08:26, Guido van Rossum <gu...@python.org> wrote:
Maybe. FWIW, I looked at what a few other languages offer, and found that
in Go, they use Trim(s, chars) for our s.strip(chars), and they have
separate TrimPrefix and TrimSuffix methods. That seems the best solution of
the bunch, so I am now okay with using stripprefix and stripsuffix. (Why no
_? Because startswith and endswith don't have one either.)

I'm somewhat against "strip" in the name, because Python's plain "strip" methods act like PHP and Go trim methods: they strip multiple characters, not fixed strings.

My own preference (and personal library use) is cutprefix and cutsuffix.

Cheers,
Cameron Simpson <c...@cskk.id.au>
_______________________________________________
Python-ideas mailing list -- python-ideas@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-ideas@python.org/message/24QQVKJAEWCXBK2ANGPUD6HFW5NPR4YM/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to