Type emulation issues with new style classes

Carmine Noviello cnoviello at hotmail.com
Sat Feb 28 06:43:44 EST 2004


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



More information about the Python-list mailing list