No, you cannot override and and or . With the behavior that they have in Python (i.e., short circuiting), they are more like control flow tools than operators, and redefining them will be more like overriding if than + or -.
You can influence the true value of your objects (that is, they are evaluated as true or false) by overriding __nonzero__ (or __bool__ in Python 3).
dF. Jan 23 '09 at 1:44 2009-01-23 01:44
source share