23 Mar
2020
23 Mar
'20
10:37 p.m.
On 22Mar2020 23:33, Rob Cliffe
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