__getattr__ is a very nice and powerful method that must be handled with care, otherwise you can discover that it has more power than you expected...
1 2 3 4 5 6 7 8 9
class SuperClass: def supermethod(self): return 'Output of "SuperClass.supermethod(self)".' class SubClass(SuperClass): def __getattr__(self, name): if name == 'special': return 'Value of attribute "special".' else: raise AttributeError, name # <<< DON'T FORGET THIS LINE !!
If you forget the last line of __getattr__ above, __getattr__ implicitly returns "None" for every attribute name other than "special" and that includes the (otherwise inherited) "supermethod" attribute, so you finish with an unexpected overload of "supermethod"!