
24 Mar
2020
24 Mar
'20
1:01 a.m.
Cameron Simpson writes:
As a diversion, _are_ there use cases where an empty affix is useful or reasonable or likely?
In the "raise on failure" design,
"aba".cutsuffix('.doc')
raises,
"aba".cutsuffix('.doc', '')
returns "aba".
BTW, since I'm here, thanks for your discussion of context managers for loop invariants. It was very enlightening.