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
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/