# HG changeset patch # User Paul Boddie # Date 1445362972 -7200 # Node ID ef754d8e1c466a286815e0ee0d73d7801d0fa741 # Parent 8a3994e54ea4b5ce7ee73f955f1f99c6ac3df522 Make the start and end of time instances behave like false values. diff -r 8a3994e54ea4 -r ef754d8e1c46 imiptools/period.py --- a/imiptools/period.py Tue Oct 20 18:39:52 2015 +0200 +++ b/imiptools/period.py Tue Oct 20 19:42:52 2015 +0200 @@ -79,6 +79,9 @@ def __rcmp__(self, other): return -self.__cmp__(other) + def __nonzero__(self): + return False + class EndOfTime(PointInTime): "A special value that compares later than other values." @@ -92,6 +95,9 @@ def __rcmp__(self, other): return -self.__cmp__(other) + def __nonzero__(self): + return False + class PeriodBase: "A basic period abstraction."