python3 uses __bool__ instead if __nonzero__