On 12/02/2021 07:32, Paul Sokolovsky wrote:
Hello,
On Fri, 12 Feb 2021 18:26:53 +1100
Chris Angelico <ros...@gmail.com> wrote:
On Fri, Feb 12, 2021 at 6:24 PM Paul Sokolovsky <pmis...@gmail.com>
wrote:
... And on the 2nd thought, that won't work. The reason it works in
JS is that it doesn't have tuples. In Python, "(a, b) => (1, 2)"
means "compare a tuple for greater-or-equal".
Should be safe actually - "=>" is not a valid comparison operator.
It may not be a valid operator - but it reads as if it could be. using
'=>' for this will decrease the readability as far as I can see.
It takes a bit of mental processing to realise this isn't a valid
comparison, and then more processing to understand what it does mean; it
will definitely be a source of confusion for beginners. The fact that a
very respected member of the community got it wrong at first sight
suggests that many will do so.
If we were going to do this - and I am still on the fence - I think we
should avoid anything that reads like it could be confused as an operator.
_______________________________________________
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/3SAONT64IU4LP4ML3XARVPESJKG25CY2/
Code of Conduct: http://python.org/psf/codeofconduct/