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 michael.foord
Recipients ezio.melotti, michael.foord, rhettinger
Date 2010-11-02.01:40:15
SpamBayes Score 2.157119e-11
Marked as misclassified No
Message-id <1288662018.68.0.386196482119.issue10242@psf.upfronthosting.co.za>
In-reply-to
Content
On Python-dev Nick Coghlan suggests a fix for the fast-path that would allow us to keep it whilst fixing this bug (not tested yet but adding this note not to lose it). The issue of the name of this method is in 10273.


Looking at assertItemsEqual, I'd be inclined to insert a check that falls back to the "unorderable_list_difference" approach in the case where "expected != sorted(reversed(expected))".

As far as I can tell, that check is a valid partial ordering detector
for any sequence that contains one or more pairs of items for which
LT, EQ and GE are all False:

>>> seq = [{1}, {2}]
>>> seq[0] < seq[1]
False
>>> seq[0] == seq[1]
False
>>> seq[0] > seq[1]
False
>>> sorted(seq)
[{1}, {2}]
>>> sorted(reversed(sorted(seq)))
[{2}, {1}]

Obviously, if the sequence doesn't contain any such items (e.g. all
subsets of each other), then it will look like a total ordering and
use the fast path. I see that as an upside :)
History
Date User Action Args
2010-11-02 01:40:19michael.foordsetrecipients: + michael.foord, rhettinger, ezio.melotti
2010-11-02 01:40:18michael.foordsetmessageid: <1288662018.68.0.386196482119.issue10242@psf.upfronthosting.co.za>
2010-11-02 01:40:17michael.foordlinkissue10242 messages
2010-11-02 01:40:15michael.foordcreate