Dekker wrote: > Is it possible to override 'and' and/or 'or'? I cannot find a special > method for it... __and__ and __rand__ and __or__ and __ror__ are for > binary manipulation... any proposals? > > Have marvelous sunday, > Marco > I guess you're looking for __nonzero__() <URL:http://docs.python.org/ref/customization.html>.
You don't actually override the boolean operators, you just tell the object how to tell others if it evaluates to True or False (Truth-testing isn't a binary operation; cf. bool(my_object)). /W -- http://mail.python.org/mailman/listinfo/python-list