diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-12-13 16:36:53 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-12-13 16:36:53 (GMT) |
commit | 4895af4ef1c91679e642c0fc81f584aecc26a7ea (patch) | |
tree | e854f0d7770beff477fd7ee94540b2e15524bddd /Lib | |
parent | 2a08b42e9523b9642c72c15dffc41e8e442b4e72 (diff) | |
download | cpython-4895af4ef1c91679e642c0fc81f584aecc26a7ea.zip cpython-4895af4ef1c91679e642c0fc81f584aecc26a7ea.tar.gz cpython-4895af4ef1c91679e642c0fc81f584aecc26a7ea.tar.bz2 |
fix the ignoring of __cmp__ method on metaclasses #7491
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_descr.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 0b21f57..87d30eb 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1222,6 +1222,15 @@ order (MRO) for bases """ # This used to crash self.assertRaises(TypeError, MyABC.a.__set__, u, 3) + def test_metaclass_cmp(self): + # See bug 7491. + class M(type): + def __cmp__(self, other): + return -1 + class X(object): + __metaclass__ = M + self.assertTrue(X < M) + def test_dynamics(self): # Testing class attribute propagation... class D(object): |