summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-03 13:59:54 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-03 13:59:54 (GMT)
commit4a5a2bc2b66f9a4a2e390dbf8d0cf0c362a0f409 (patch)
treee35235a7ffad86089859747ad056aa481a53ac78 /Lib/test/test_descr.py
parent1e1de1cf35ebd6b3cfcc20e40991fa437b8e9864 (diff)
downloadcpython-4a5a2bc2b66f9a4a2e390dbf8d0cf0c362a0f409.zip
cpython-4a5a2bc2b66f9a4a2e390dbf8d0cf0c362a0f409.tar.gz
cpython-4a5a2bc2b66f9a4a2e390dbf8d0cf0c362a0f409.tar.bz2
dynamics(): add a dummy __getattr__ method to the C class so that the
test for modifying __getattr__ works, now that slot_tp_getattr_hook zaps the slot if there's no hook. Added an XXX comment with a ref back to slot_tp_getattr_hook.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 36703f5..4ed6853 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -870,6 +870,11 @@ def dynamics():
# Test dynamic instances
class C(object):
__dynamic__ = 1
+ # XXX Ideally the following def shouldn't be necessary,
+ # but it's too much of a performance burden.
+ # See XXX comment in slot_tp_getattr_hook.
+ def __getattr__(self, name):
+ raise AttributeError, name
a = C()
verify(not hasattr(a, "foobar"))
C.foobar = 2