is it a bug ?

Fredrik Lundh fredrik at pythonware.com
Mon Oct 23 06:05:20 EDT 2006


Sylvain Ferriol wrote:

> i just want a class variable named 'eq'

so why are you assigning another class' descriptor to it?  descriptors 
are bound to types, and only works properly if used with the type they 
were created for.

> why i can not create some class variables like this ?
 >
> class toto(object):
>    a= float.__eq__
>    b= str.__eq__

but given that "toto" is neither a float nor a str, what do you expect 
that code to *do*?

is this some "programming by random mutation" exercise?

</F>




More information about the Python-list mailing list