diff --git a/Lib/test/test_compare.py b/Lib/test/test_compare.py index 9184355f2f4..1d8b9476723 100644 --- a/Lib/test/test_compare.py +++ b/Lib/test/test_compare.py @@ -44,5 +44,13 @@ def test(): print "%s == %s" % (a, b) else: print "%s != %s" % (a, b) + # Ensure default comparison compares id() of args + L = [None] + for i in range(10): + L.insert(len(L)/2, Empty()) + for a in L: + for b in L: + if cmp(a, b) != cmp(id(a), id(b)): + print "ERROR:", cmp(a, b), cmp(id(a), id(b)), id(a), id(b) test()