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~