]> granicus.if.org Git - python/commitdiff
Add a test for a weird bug I just discovered: a dynamic subclass
authorGuido van Rossum <guido@python.org>
Tue, 14 Aug 2001 20:00:33 +0000 (20:00 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 14 Aug 2001 20:00:33 +0000 (20:00 +0000)
doesn't have a __dict__!

Lib/test/test_descr.py

index bdde4519695fb216766d3f50c3b882068378c002..e4615260220a0d88e6a9a8d4e0eae32214df0944 100644 (file)
@@ -613,6 +613,11 @@ def dynamics():
     else:
         verify(0, "expected AttributeError")
     verify(a.spam == "spam")
+    class D(C):
+        pass
+    d = D()
+    d.foo = 1
+    verify(d.foo == 1)
 
 def errors():
     if verbose: print "Testing errors..."