On Thu, Feb 11, 2021 at 09:36:25PM -0800, Guido van Rossum wrote:

> Agreed. I'd prefer the JavaScript solution, since -> already has a
> different meaning in Python return *type*. We could use -> to simplify
> typing.Callable, and => to simplify lambda.

Please no! That will lead to constant confusion for people who can't 
remember which arrow operator to use. Is -> the return type symbol or 
the return value symbol? I forsee many Stackoverflow questions "What's 
the difference between -> and => ?"

We've seen Paul mistake => for >= and he's not the only one.

We already have chosen -> as the return type symbol in annotations, 
there is no ambiguity with also using it as the return value symbol. We 
could even allow both:

    (values:List[float], arg=0:int -> Type) -> expression

There are plenty of popular and influential languages that use the 
single line arrow -> such as Maple, Haskell, Julia, CoffeeScript, Erlang 
and Groovy, to say nothing of numerous lesser known and obscure 
languages.



-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/WBQ6FHBF4253QZR77PQOVWWYUMCBHXQI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to