Merge "Add __bool__ for classes that implement __nonzero__"

This commit is contained in:
Jenkins 2015-10-12 21:53:18 +00:00 committed by Gerrit Code Review
commit 5c24ffcb78

View File

@ -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