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.
# 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