From 42d5947ef5263c8227e37050ff801131992bcb90 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 6 Feb 2010 20:14:10 +0000 Subject: [PATCH] check type_getattro for correctness in a descriptor corner case --- Lib/test/test_descr.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index ab5a1ea3eae..b0366bd944c 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4516,6 +4516,15 @@ order (MRO) for bases """ x.a = 42 self.assertEqual(x.a, 42) + # Also check type_getattro for correctness. + class Meta(type): + pass + class X(object): + __metaclass__ = Meta + X.a = 42 + Meta.a = Descr("a") + self.assertEqual(X.a, 42) + def test_getattr_hooks(self): # issue 4230