25 Mar
2019
25 Mar
'19
1:35 p.m.
On 3/25/2019 6:22 AM, Jonathan Fine wrote:
Instead of naming these operations, we could use '+' and '-', with semantics:
# Set the values of the variables. >>> a = 'hello ' >>> b = 'world' >>> c = 'hello world'
# Some values between the variables. >>> a + b == c True >>> a == c - b True >>> b = -a + c True
Summary: using '-' for trimming works well for postfixes, badly for prefixes, and not at all for infixes. Clever but not too practical since trimming prefixes seems to be more common than trimming postfixes. -- Terry Jan Reedy