summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_compare.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_compare.py')
-rw-r--r--Lib/test/test_compare.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_compare.py b/Lib/test/test_compare.py
index 9184355..1d8b947 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()