class Z(object): value = 42 def __hasattr__(self, name): if name == '__int__': return True def __int__(self): return self.value Umm, maybe I haven't understood what you need. -- Don't you know why your Python application has crashed? Take a look to http://www.pycrash.org -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG