defining __nonzero__ doesn't work as expected