[Python-ideas] Left arrow and right arrow operators

Nick Timkovich prometheus235 at gmail.com
Tue Mar 12 10:57:58 EDT 2019


In general, there is lots of code out in the wild that can't be updated for
whatever reason, e.g. the person that knows Python left and it needs to
continue to work. Weak argument, but cost-benefit I think it comes out
ahead. In your example there isn't a reason I can tell why swapping the
operands isn't what should be done as Calvin mentioned. The onus is on you
to positively demonstrate you require both directions, not him to
negatively demonstrate it's never required.

I suggest you confine your proposal to `->` only, as it's currently illegal
syntax. You would also want the reflected `__r*__` equivalent of
`__arrow__` or `__rarrow__` (`__rrarrow__` if you also need the
left-arrow...)

Perhaps broadening the use of it, functions may be able to use it as a pipe
operator, e.g. Elixir:
https://elixir-lang.org/getting-started/enumerables-and-streams.html#the-pipe-operator

On Mon, Mar 11, 2019 at 2:58 PM francismb <francismb at email.de> wrote:

> Hi Greg,
>
> On 3/9/19 1:42 AM, Greg Ewing wrote:
> > Do you really want
> > to tell them that all their code is now wrong?
> Of course not, at least not so promptly. But, would it be still a
> problem if the update to a new version (let say from 3.X to next(3.X))
> is done through some kind of updater/re-writer/evolver. In that case the
> evolver could just add the blanks. What do you think ? Could it work?
>
> Thanks in advance!
> --francis
> _______________________________________________
> 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/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20190312/a754b004/attachment.html>


More information about the Python-ideas mailing list