diff -r 2d0a855ce30a Lib/test/test_descr.py --- a/Lib/test/test_descr.py Sun Apr 03 18:45:42 2011 +0200 +++ b/Lib/test/test_descr.py Sun Apr 03 22:35:07 2011 +0200 @@ -625,6 +625,27 @@ # The most derived metaclass of D is A rather than type. class D(B, C): pass + self.assertIs(A, type(D)) + + # issue1294232: the __prepare__ of the most derived + # metaclass should be called + class A(type): + @classmethod + def __prepare__(mcls, name, bases): + return {'A_was_here': True} + + class B: + pass + + class C(metaclass=A): + pass + + # The most derived metaclass of D is A + class D(B, C): + pass + + # A.__prepare__ should've been called: + self.assertIn('A_was_here', D.__dict__) def test_module_subclasses(self): # Testing Python subclass of module...