class empty: def __getattr__(self, attrname): if attrname == "age": return 41 else: raise AttributeError, attrnameX = empty()print X.age