On Sun, Oct 24, 2021 at 12:39:38PM +0100, Matt del Valle wrote:
> I'll confess though I'm not a fan of any of the alternate syntaxes. I think
> => works really well, particularly if lambdas in the form: `(*args) =>
> expr` are added at some point in the future
So if we have the arrow shortcut for type hints, and an arrow shortcut
for lambda, then we can write code like this:
def func(arg:int->int=>x=>x+1)->int:
"I felt a great disturbance in the Force. As if millions of voices cried
out in terror, and were suddenly silenced."
I think that the likelihood of using an arrow for lambdas and type
hinting is a major point against this proposed arrow syntax.
And the arrow points the wrong way for an assignment! When we want to
show a name binding, we write:
name <- value
value -> name
we don't have name->value. Example:
https://www.r-bloggers.com/2018/09/why-do-we-use-arrow-as-an-assignment-operator/
I don't see any language that uses an arrow pointing from the name to
value for assignment:
https://en.wikipedia.org/wiki/Assignment_%28computer_science%29#Notation
https://i.redd.it/e2kmjoxmy7k61.jpg
--
Steve
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/63OVHICOY5RUW473ZKD4THQLRQDNIRR3/
Code of Conduct: http://python.org/psf/codeofconduct/