programming logical functions: myand, myor and mynot

John Roth johnroth at
Thu Nov 15 02:49:57 CET 2001

"Gernot" <headroom02 at> wrote in message
news:9sv2c7$6qa$06$1 at
> Hi,
> I want to implement the functions myand, myor and mynot. They should
> the same effect as the known boolean operators and, or and not.
> The trick is that I am not allowed to use the boolean operators and,
or and
> not.
<example snipped>

AFIK, it can't be done because the 'and' and 'or' operators have
short circuit evaluation. There is no way to build a function that
does not evaluate each of its arguments before invoking the

John Roth

More information about the Python-list mailing list