[Python-ideas] Left arrow and right arrow operators

Calvin Spealman cspealma at redhat.com
Mon Mar 4 08:09:21 EST 2019


I don't like the idea of arrows in both directions when you can just swap
the operands instead

On Sun, Mar 3, 2019 at 9:52 AM francismb <francismb at email.de> wrote:

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


-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

cspealma at redhat.com  M: +1.336.210.5107
<https://red.ht/sig>
TRIED. TESTED. TRUSTED. <https://redhat.com/trusted>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190304/f1e0e067/attachment-0001.html>


More information about the Python-ideas mailing list