[Tutor] __and_ and and_
Joseph J. Strout
joe@strout.net
Mon, 18 Oct 1999 10:24:00 -0700
At 5:57 PM +0100 10/18/99, Arne Mueller wrote:
>Why doesn't the 'in-operator' '__and__' behave the same way as 'and_'?
Because __and__ is the special method for overriding '&' (bitwise
and), not 'and' (Boolean and). You didn't override the latter, so it
does what it normally does -- if both arguments are true, it returns
the first one.
I don't see a way to override the 'and' or 'or' operators... you
might be stuck using & and | instead. Anybody have a better idea?
Cheers,
-- Joe
,------------------------------------------------------------------.
| Joseph J. Strout Biocomputing -- The Salk Institute |
| joe@strout.net http://www.strout.net |
`------------------------------------------------------------------'