[issue39939] PEP 616: Add str methods to remove prefix or suffix

Raymond Hettinger report at bugs.python.org
Mon Apr 20 17:58:26 EDT 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I disagree with the rationale given in the PEP.  The reason that "startswith" and "endswith" don't have underscores is that the aren't needed to disambiguate the text.  Our rules are to add underscores when it improves readability, which in this case it does.   Like casing conventions, these rules became prevent after the early modules were created (i.e. the older the module, the more likely that it doesn't follow modern conventions).

We only have one chance to get this right.  Take it from someone with experience with this particular problem.  I created imap() but later regretted the naming pattern when if came to ifilter() and islice() which sometimes cause mental hiccups initially being read as if-ilter and is-lice.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39939>
_______________________________________


More information about the Python-bugs-list mailing list