Author smarnach
Recipients barry, christian.heimes, gvanrossum, mark.dickinson, mikecurtis, rhettinger, smarnach
Date 2011-06-27.15:00:51
SpamBayes Score 2.07428e-08
Marked as misclassified No
Message-id <>
The behaviour discussed in this thread does not seem to be reflected in Python's documentation.  The documentation of __eq__() [1] doesn't mention that objects should compare equal to themselves.


There are several places in the documentation that are wrong for NaNs; just one example is the documentation of sequence types [2], which states:

> This means that to compare equal, every element must compare equal
> and the two sequences must be of the same type and have the same
> length.


It's probably not worthwhile to "fix" all the places in the documentation that implicitly assume that objects compare equal to themselves, but it probably is a good idea to mention that __eq__() implementations should fulfil this assumption to avoid strange behaviour when used in combination with standard containers.  Any thoughts?
Date User Action Args
2011-06-27 15:00:52smarnachsetrecipients: + smarnach, gvanrossum, barry, rhettinger, mark.dickinson, christian.heimes, mikecurtis
2011-06-27 15:00:51smarnachsetmessageid: <>
2011-06-27 15:00:51smarnachlinkissue4296 messages
2011-06-27 15:00:51smarnachcreate