__getattr__ and __cmp__

Rainer Deyke root at rainerdeyke.com
Wed Oct 4 23:27:29 EDT 2000


"Michel Sanner" <sanner at scripps.edu> wrote in message
news:mailman.970714333.17928.python-list at python.org...
> Hi,
>
> This is using Python 1.5.2 under IRIX6.5
>
> Could anyone tell me how to specialize __getattr__ without loosing default
> instance comparison ?
>
> here is what the problem is:
>
> class A:
>   def __init__(self):
>       self.val=1

    def __cmp__(self, other):
      return cmp(id(self), id(other))


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list