On Sun, Feb 14, 2021 at 8:42 PM Steven D'Aprano <st...@pearwood.info> wrote: > We should not choose the more confusing, error-prone solution out of > fear of being different. Python is already different from Javascript in > every regard: >
Is it really? > - the basic execution model is different; Don't know what you mean here, but I thought they were the same. > - the object model is different; Same object model. > - the numeric model is different; Python has more data types, but that's not as fundamental a difference as you might think > -the truthy/falsey model is different; There are different rules about WHAT is truthy/falsy, but, again, the differences aren't fundamental > - the syntax is different; > - the list of keywords is different; > - the standard library is different; > - the list of operators is different; Well, of course. If these four were the same, they'd be the same language. These four differ between Py2 and Py3 too. > - even basic equality is different; Yes, although that's more historic than anything else - most people use "===" which has mostly the same semantics as Python's equality > - the culture of the community is different. TBH neither community has a single culture. https://tvtropes.org/pmwiki/pmwiki.php/Main/NotSoDifferent Python and JavaScript can learn a LOT from each other, because the languages are actually pretty similar. Yes, of course there are differences, but there are similarities too. Python has fewer similarities with C than with JS, but still enough to learn from. > "Javascript spells it this way" might be a compelling argument if the > choice between the two symbols was neutral, but it isn't: > > * the double line arrow => is confusable with greater-than-or-equal; > > * the single line arrow -> is already used in Python for a related, > but unambiguously distinct, meaning. > I think this is the key to the whole argument. *IS it* unambiguously distinct? There are enough other languages using "=>" AND enough other languages using "->" that using either in Python will be following prior art. The only real difference is that Python has one of them in use, and the other not in use. I personally don't much care whether it's spelled "=>" or "->", but I'd say the best way to judge the potential ambiguity is to try it with "->" and see how it looks. ChrisA _______________________________________________ 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/YJH4QMVDCHCIKRXYVICWV4I3Q6E62VZO/ Code of Conduct: http://python.org/psf/codeofconduct/