[Python-ideas] Left arrow and right arrow operators
francismb
francismb at email.de
Sun Mar 3 09:46:24 EST 2019
Hi,
the idea here is just to add the __larrow__ and __rarrow__ operators for
<- and ->.
E.g. of use on dicts :
>>> d1 = {'a':1, 'b':1 }
>>> d2 = {'a':2 }
>>> d3 = d1 -> d2
>>> d3
{'a':1, 'b':1 }
>>> d1 = {'a':1, 'b':1 }
>>> d2 = {'a':2 }
>>> d3 = d1 <- d2
>>> d3
{'a':2, 'b':1 }
Or on bools as Modus Ponens [1]
Or your idea/imagination here :-)
Regards,
--francis
[1] https://en.wikipedia.org/wiki/Modus_ponens
More information about the Python-ideas
mailing list