Directly Overloading ==

Aahz Maruch aahz at panix.com
Wed Sep 13 09:23:12 EDT 2000


In article <39BECD50.CF19C401 at earthlink.net>,
Terry Hancock  <hancock at earthlink.net> wrote:
>
>Can you do it?

Not right now.

>Yes I know you can use __cmp__(), but that's not the same thing (yes, I
>did look it up in the language reference).
>
>IMHO, it would be extremely convenient to overload the "==" operator
>directly, to change it to return a fuzzy logic value indicating the
>*degree* of equality rather than absolute equality (which as with float
>values is pretty pointless with fuzzy logic).

It's on the agenda for the future (see
http://python.sourceforge.net/peps/pep-0207.html), but its status is
very fuzzy right now.  ;-)  I believe the primary aim of the rich
comparisons project isn't going to support your goals, but from what
I've heard of it, it should be adaptable.
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"I'm not aware of any public servant on Usenet, and thank God for that."  --rra



More information about the Python-list mailing list