On 2020-03-21 20:38, Guido van Rossum wrote:
It's not great, and I actually think that "stripprefix" and "stripsuffix" are reasonable. (I found that in Go, everything we call "strip" is called "Trim", and there are "TrimPrefix" and "TrimSuffix" functions that correspond to the PEP 616 functions.)

To jump on the bikeshed, trimprefix and trimsuffix are the best I've read so far, due to the definitions of the words in English.

Though often used interchangeably, when I think of "strip" I think of removing multiple things, somewhat indiscriminately with an arm motion, which is how the functions currently work. e.g. "strip paint", "strip clothes":

    https://www.dictionary.com/browse/strip
    to take away or remove

When I think of trim, I think more of a single cut of higher precision with scissors. e.g. "trim hair", "trim branches":

    https://www.dictionary.com/browse/trim
    to put into a neat or orderly condition by clipping…


Which is what this method would do. That trim matches Go is a small but decent benefit. Another person warned against inconsistency with PHP, but don't think PHP should be considered for design guidance, IMHO. Perhaps as an example of what not to do, which happily is in agreement with the above.

-Mike

p.s. +1, I do support this PEP, with or without name change, since some mentioned concern over that.
_______________________________________________
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/PE7KP36HUDXCQX7NYGEXSECOQOMVDZKG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to