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 Dubslow
Recipients Dubslow, docs@python
Date 2017-11-23.04:27:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za>
In-reply-to
Content
In sequence comparisons, the enforcement of reflexivity of elements means that only non-identical elements are actually compared. The docs then note, with example, that non-reflexive elements thus always "compare" equal inside the sequence.
    
    This patch adds a second corollary, that non-orderable singletons (e.g. None) will also not break sequence comparison.
    
    Yes, the consequence is logically derivable from the statement "element identity is compared first, and element comparison is performed only for distinct elements", but the first example is given because "For non-reflexive elements, the result is different than for strict element comparison, and may be surprising", which also holds for the example I add here: different from strict element comparison, which may lead to otherwise surprising results (it sure was surprising to me when I expected a list with Nones to fail to compare, hence why I went trawling through the docs). In the manner of the first example, explicit is better than implicit, and (I believe) it will be helpful for readers to have this second consequence demonstrated.
History
Date User Action Args
2017-11-23 04:27:01Dubslowsetrecipients: + Dubslow, docs@python
2017-11-23 04:27:01Dubslowsetmessageid: <1511411221.22.0.213398074469.issue32118@psf.upfronthosting.co.za>
2017-11-23 04:27:01Dubslowlinkissue32118 messages
2017-11-23 04:27:00Dubslowcreate