On 08Mar2020 00:17, MRAB <pyt...@mrabarnett.plus.com> wrote:
On 2020-03-07 23:01, Cameron Simpson wrote:
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.

Go's Trim strips multiple characters, but, as far as I can tell from the docs, TrimPrefix and TrimSuffix strip a single prefix/suffix string.

And right there is the confusion I'd rather avoid. I'd like the affix stuff to have a different name because it behaves differently.

We've got strip, lstrip and rstrip with common "strip multiple characters" actions. I think fixed affixes are different enough to warrant a differently spelled name.

I hope we can agree to at least avoid using the word "trim", for similar reasons.

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

Reply via email to