is it a bug ?

Fredrik Lundh fredrik at pythonware.com
Mon Oct 23 05:15:16 EDT 2006


Sylvain Ferriol wrote:

> can you explain to me what happened:
> 
> class toto(object):
>    eq = float.__eq__
> 
> t = toto()
> 
> getattr(t,'eq')
> TypeError: descriptor '__eq__' for 'float' objects doesn't apply to 
> 'toto' object

I'd say the error message explains it pretty well.  what did you expect 
this to do?

</F>




More information about the Python-list mailing list