In order to monitor access of class attributes, I tried to replace class __dict__ with UserDict. class Foo: pass class MyUserDict(UserDict.UserDict): def __getitem__(self, name): ...... Foo.__dict__ = MyUserDict(Foo.__dict__) But python bit me with: TypeError: __dict__ must be a dictionary object How can I avoid this kind error.