Ways are also attributes. __getattr__ works the same for them:
class A(object): def __getattr__(self, attr): print attr
Then try:
>>> a = A() >>> a.thing thing >>> a.thing() thing Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: 'NoneType' object is not callable
source share