Merge "Add __bool__ for classes that implement __nonzero__"
This commit is contained in:
commit
5c24ffcb78
@ -794,6 +794,9 @@ class Timestamp(object):
|
||||
def __nonzero__(self):
|
||||
return bool(self.timestamp or self.offset)
|
||||
|
||||
def __bool__(self):
|
||||
return self.__nonzero__()
|
||||
|
||||
@property
|
||||
def normal(self):
|
||||
return NORMAL_FORMAT % self.timestamp
|
||||
|
Loading…
Reference in New Issue
Block a user