On Fri, Jun 28, 2019 at 01:08:45AM +1000, Chris Angelico wrote: > Help on built-in function lstrip: [...] > This does NOT remove a leading substring. It removes a set of characters.
This is a re-occurring painpoint and gotcha. I've fallen for it myself. I really think it's long past time we bite the bullet and add a pair of methods to strip a prefix and suffix from strings. My preferred bikeshed colour would be strip_prefix and strip_suffix. Will this need a PEP? -- Steven _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/HEZVBBVAV57AZ37KB6FUNYP7ENOBOIAU/