All I want is for bool(myInstance) to return False (and for myInstance to evaluate to False when in a conditional like if/or/and. I know how to override >, <, =)
I've tried this:
class test:
def __bool__(self):
return False
myInst = test()
print bool(myInst) #prints "True"
print myInst.__bool__() #prints "False"
Any suggestions?
(I am using Python 2.6)