
March 22, 2020
5:07 a.m.
On 21Mar2020 14:40, Eric V. Smith <eric@trueblade.com> wrote:
On 3/21/2020 2:09 PM, Steven D'Aprano wrote:
If you want to know whether a prefix/suffix was removed, there's a more reliable way than identity and a cheaper way than O(N) equality. Just compare the length of the string before and after. If the lengths are the same, nothing was removed.
That's a good point. This should probably go in the PEP, and maybe the documentation.
+1000 to this. - Cameron