On Tue, Nov 2, 2010 at 1:33 AM, R. David Murray <rdmur...@bitdance.com> wrote:
> Or, to put it another way, *if* there is a bug here it would be in set,
> not sorted.

Put me in the "it's not a bug, it's a feature" camp. Providing a
"elements equal" check that doesn't rely on LT providing a total
ordering is a non-trivial exercise.

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))" (only need to check the
one, since if the expected values are totally ordered, while the
actual values are not, this should show up when comparing the
elements). It slows down the fast path a bit, but the updated function
should at least handle partial orderings more correctly than it does
now.

Cheers,
Nick.

P.S. Late night post, so I may be missing something obvious...

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to