You probably want to look at truth operator overloading http://docs.python.org/library/operator.html On a side note, you may also want to look into Mock object helpers http://python-mock.sourceforge.net/ depending on what your trying to do. They are useful on several levels, but the mock library itself needs to do things like truth testing. Brian Ray