On 03/20/2020 11:52 AM, Dennis Sweeney wrote:
Browser Link: https://www.python.org/dev/peps/pep-0616/
PEP: 616 Title: String methods to remove prefixes and suffixes
Thank you, Dennis, for putting this together! And Eric for sponsoring. :)
Overall I think it's a good idea, but...
Alternative Method Names
``stripprefix`` Users may benefit from the mnemonic that "strip" means working with sets of characters, while other methods work with substrings, so re-using "strip" here should be avoided.
Um, what mnemonic?
I am strongly opposed to the chosen names of `cut*` -- these methods do basically the same thing as the existing `strip` methods (remove something from either end of a string), and so should have similar names:
- the existence of `stripsuffix` is a clue/reminder that `strip` doesn't work with substrings
- if all of these similar methods have similar names they will be grouped together in the documentation making discovery of the correct one much easier.
So for this iteration of the PEP, I am