PyClass_New and __getattr__

Vlado sironja at
Thu Nov 22 11:32:27 CET 2001

here a short question; I'm extending python through
some C++ classes. I have defined a new
type with PyClass_New() and added __getattr__ 
and __setattr__ to the class dictionary.
However, these two get/set methods are not being called 
if class member resolve fails. 
An explicit call succeeds though, e.g.

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: Test instance has no attribute 'i'
ok, test_getattr called

Am i missing something?
Thank you.

ps. using Python21 and Python22a3 on win32

More information about the Python-list mailing list