summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-01-07 13:41:37 (GMT)
committerGuido van Rossum <guido@python.org>2003-01-07 13:41:37 (GMT)
commit373c7412f297c375d84c5984f753557b441dd6f4 (patch)
tree4ab1908125675023d61bb0670eaaf6a5acab8f55 /Lib
parent145a4a0f10009f7ce2644465ccd359938b034ac4 (diff)
downloadcpython-373c7412f297c375d84c5984f753557b441dd6f4.zip
cpython-373c7412f297c375d84c5984f753557b441dd6f4.tar.gz
cpython-373c7412f297c375d84c5984f753557b441dd6f4.tar.bz2
Fix for SF bug #642358: only provide a new with a __dict__ or
__weaklist__ descriptor if we added __dict__ or __weaklist__, respectively. With unit test.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_descr.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 974fd25..023fcc8 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -3686,6 +3686,19 @@ def subclass_right_op():
vereq(E(1) / C(1), "C.__div__")
vereq(C(1) / E(1), "C.__div__") # This one would fail
+def dict_type_with_metaclass():
+ if verbose:
+ print "Testing type of __dict__ when __metaclass__ set..."
+
+ class B(object):
+ pass
+ class M(type):
+ pass
+ class C:
+ # In 2.3a1, C.__dict__ was a real dict rather than a dict proxy
+ __metaclass__ = M
+ veris(type(C.__dict__), type(B.__dict__))
+
def test_main():
do_this_first()
@@ -3771,6 +3784,7 @@ def test_main():
test_mutable_bases_catch_mro_conflict()
mutable_names()
subclass_right_op()
+ dict_type_with_metaclass()
if verbose: print "All OK"