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-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/JKBILM3G2C4TQ7XEVIH3V7M7CKCJ4R6Y/
Code of Conduct: http://python.org/psf/codeofconduct/