On 22Mar2020 23:33, Rob Cliffe <rob.cli...@btinternet.com> wrote:
Sorry, another niggle re handling an empty affix:  With your Python implementation,
'aba'.cutprefix(('', 'a')) == 'aba'
'aba'.cutsuffix(('', 'a')) == 'ab'
This seems surprising.

That surprises me too. I expect the first matching affix to be used. It is the only way for the caller to have a predictable policy.

As a diversion, _are_ there use cases where an empty affix is useful or reasonable or likely?

Cheers,
Cameron Simpson <c...@cskk.id.au>
_______________________________________________
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/ZL4HWLP7TI3CAKM65WXXGTTTE77A7YSL/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to