[Python-ideas] checking for identity before comparing built-in objects
alexander.belopolsky at gmail.com
Mon Oct 8 04:33:37 CEST 2012
On Sun, Oct 7, 2012 at 9:51 PM, Guido van Rossum <guido at python.org> wrote:
> Referencing Java here is absurd and I still consider this suggestion
> as a troll. Python is not in any way based on Java.
I did not suggest that. Sorry if it came out this way. I am well
aware that Python and Java were invented independently and have
different roots. (IIRC, Java was born from Oak and Python from ABC
and Oak and ABC were both developed in the 1980s.) IEEE 784 precedes
both languages and one team decided that equality reflexivity for
hashable objects was more important than IEEE 784 compliance while the
other decided otherwise.
Many Python features (mostly library) are motivated by C. In the 90s,
"because C does it this way" was a good explanation for a language
feature. Doing things differently from the "C way", on the other hand
would deserve an explanation. These days, C is rarely first language
that a student learns. Hopefully Python will take this place in not
so distant future, but many students graduated in late 90s - early
2000s knowing nothing but Java. As a result, these days it is a
valid question to ask about a language feature: "Why does Python do X
differently from Java?" Hopefully in most cases the answer is
"because Python does it better."
In case of nan != nan, I would really like to know a modern reason why
Python's way is better. Better compliance with a 20-year old standard
does not really qualify.
More information about the Python-ideas