Author gvanrossum
Recipients Dennis Sweeney, eric.smith, gvanrossum, rhettinger, steven.daprano, vstinner, xtreak
Date 2020-03-16.04:32:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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().
Date User Action Args
2020-03-16 04:32:55gvanrossumsetrecipients: + gvanrossum, rhettinger, vstinner, eric.smith, steven.daprano, xtreak, Dennis Sweeney
2020-03-16 04:32:55gvanrossumsetmessageid: <>
2020-03-16 04:32:55gvanrossumlinkissue39939 messages
2020-03-16 04:32:54gvanrossumcreate