Here's an interesting class, from a program I wrote: from datetime import ( date , MINYEAR , MAXYEAR , timedelta , ) class DateInterval : BEGINNING_OF_TIME = date ( MINYEAR , 1 , 1 ) END_OF_TIME = date ( MAXYEAR , 12 , 31 ) def init ( self , start = None , end = None ): if start is None : start = self . BEGINNING_OF_TIME if end is None : end = self . END_OF_TIME if start > end : raise ValueError ( f " Start date { start } must not be after end date { end } " ) self . start = start self . end