Guido van Rossum <gu...@python.org> added the comment:

I stopped following the discussion at some point, but I think this is worth 
adding it -- I have seen this done over and over again, and apparently lots of 
other people have felt the need too.

I think these names are fine, and about the best we can do (keeping in line 
with the "feel" of the rest of the string API).

I like the behavior of returning a copy of the string if there's no match (as 
opposed to failing, which was also brought up).  If the original object is 
immutable this should return the original object, but that should be considered 
a CPython optimization (IIRC all the string methods are pretty careful about 
that), but not required by the spec.

FWIW the pseudo code has a copy/paste error: In cutsuffix() it should use 
endswith() rather than startswith().

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39939>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to