This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients mark.dickinson, rhettinger, serhiy.storchaka, tim.peters, vstinner, wbolster
Date 2017-07-21.16:02:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500652922.84.0.263914110405.issue30907@psf.upfronthosting.co.za>
In-reply-to
Content
I never understood how container comparison works.

>>> nan = float("nan")
>>> [nan] == [nan]
True
>>> (nan,) == (nan,)
True
>>> nan == nan
False
>>> nan is nan
True

I picked the float NaN because it's one of the weirdest object in Python: it's not equal to itself.

I don't know what is the impact of the proposed change on comparison. Can it break an application? It's unclear to me.

--

It also recalls me an optimization I proposed on string: begin with comparison on the hash, if the two hashs are already known. At the end, we decided that it wasn't worth it.

--

Raymond, Tim and Serhiy don't seem to be convince, so I will follow them and agree to reject this optimization :-)
History
Date User Action Args
2017-07-21 16:02:02vstinnersetrecipients: + vstinner, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, wbolster
2017-07-21 16:02:02vstinnersetmessageid: <1500652922.84.0.263914110405.issue30907@psf.upfronthosting.co.za>
2017-07-21 16:02:02vstinnerlinkissue30907 messages
2017-07-21 16:02:02vstinnercreate