Why doesn\'t this work as one may have naively expected?
class Foo(object): def __init__(self): self.bar = 3 def __bool__(self): retu
Because the corresponding special method is called __nonzero__() in Python 2, and not __bool__() until Python 3.