relational/boolean operator overloading

Renzo Tomaselli renzo.tomaselli at tecnotp.it
Mon Mar 19 03:49:37 EST 2001


Aahz Maruch wrote in message <98tk4b$sbv$1 at panix3.panix.com>...
>In article <98tjq6$qre$1 at news.flashnet.it>,
>Renzo Tomaselli <renzo.tomaselli at tecnotp.it> wrote:
>>
>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, http://python.sourceforge.net/peps/pep-0207.html

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.
Thanks,
                Renzo Tomaselli






More information about the Python-list mailing list