From: Tim H. <tim...@ie...> - 2002-06-12 20:37:26
|
From: "Chris Barker" <Chr...@no...> > I imagine there is a compelling reason that "and" and "or" have not been > overridden like the comparison operators, but it sure would be nice! Because it's not possible? "and" and "or" operate on the basis of the truth of their arguments, so the only way you can affect them is to overide __nonzero__. Since this is a unary operation, there is no way to get the equivalent of logical_and out of it. In practice I haven't found this to be much of a problem. Nearly every time I need to and two arrays together, "&" works just as well as logical_and. I can certainly imagin ecases where this isn't true, I just haven't run into them in practice. -tim |