Overload __nonzero__ method to overwrite zero boolean behaviour
Overload __nonzero__
class NumStr(object):
def __nonzero__(self): # False if both are
return self.__num or len(self.__string)
class NumStr(object):
def __nonzero__(self): # False if both are
return self.__num or len(self.__string)