relational/boolean operator overloading

Aahz Maruch aahz at
Tue Mar 20 06:49:50 CET 2001

In article <994h71$ohq$1 at>,
Renzo Tomaselli <renzo.tomaselli at> wrote:
>Aahz Maruch wrote in message <98tk4b$sbv$1 at>...
>>Not sure what advice to give you with current Python, but Python 2.1
>>introduces rich comparisons, which may give you what you want.  See
>>PEP 207,
>Pep 207 looks great for my posted topic. However its solves half of the
>problem. The missing part is about overloading 'and'/'or' operators, also
>because this PEP allows for comparisons returning any object. How to chain
>such results with booleans, beside a trivial truth test ?
>Say we have: "(sa > 10) and (sb < 100)". I would expect PEP overloading to
>carry out relational filtering for the two sets and to return two result
>sets, while some "and" overloading would connect them to return a final
>result set.

There's some stuff being done on the numeric side of Python that may be
relevant (in terms of set operators and such).  I don't know enough
about it to give you a good search term, though.
                      --- Aahz  <*>  (Copyright 2001 by aahz at

Androgynous poly kinky vanilla queer het Pythonista
Hugs and backrubs -- I break Rule 6

There's a difference between a person who gets shit zie doesn't deserve
and a person who gets more shit than zie deserves.  --Aahz

More information about the Python-list mailing list