Why doesn\'t this work as one may have naively expected?
class Foo(object): def __init__(self): self.bar = 3 def __bool__(self): retu
The __bool__ method is used in Python 3. For Python 2, you want __nonzero__.
__nonzero__