
March 23, 2020
10:37 p.m.
On 22Mar2020 23:33, Rob Cliffe <rob.cliffe@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 <cs@cskk.id.au>