[Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.80,1.81
Guido van Rossum
gvanrossum@users.sourceforge.net
Wed, 03 Oct 2001 06:59:57 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv20567
Modified Files:
test_descr.py
Log Message:
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.
Index: test_descr.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** test_descr.py 2001/10/02 19:58:32 1.80
--- test_descr.py 2001/10/03 13:59:54 1.81
***************
*** 871,874 ****
--- 871,879 ----
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"))