[Python-Dev] == on object tests identity in 3.x - list delegation to members?

Marko Rauhamaa marko at pacujo.net
Sun Jul 13 21:54:02 CEST 2014

Nick Coghlan <ncoghlan at gmail.com>:

> Right, it's not a mere optimisation - it's the only way to get
> containers to behave sensibly. Otherwise we'd end up with nonsense
> like:
>>>> x = float("nan")
>>>> x in [x]
> False

Why is that nonsense? I mean, why is it any more nonsense than

   >>> x == x

Anyway, personally, I'm perfectly "happy" to live with the choices of
past generations, regardless of whether they were good or not. What you
absolutely don't want to do is "correct" the choices of past generations.


More information about the Python-Dev mailing list