On 21Mar2020 14:40, Eric V. Smith <e...@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
_______________________________________________
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/GHBT5RREZRMKXZDE6ZG3EZGLU3CM7VNW/
Code of Conduct: http://python.org/psf/codeofconduct/