File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -334,6 +334,10 @@ def __eq__(self, other: object) -> bool:
334334
335335 def __lt__ (self , other : object ) -> bool :
336336 other = self ._comparison_type (other )
337+ if other is NotImplemented :
338+ # return NotImplemented to indicate comparison is not supported
339+ # with this type
340+ return NotImplemented
337341
338342 # if either date has a completely unknown year, then we can't compare
339343 if self .unknown_year or other .unknown_year :
@@ -394,6 +398,10 @@ def __contains__(self, other: object) -> bool:
394398 # if the two dates are strictly equal, don't consider
395399 # either one as containing the other
396400 other = self ._comparison_type (other )
401+ if other is NotImplemented :
402+ # return NotImplemented to indicate comparison is not supported
403+ # with this type
404+ return NotImplemented
397405
398406 if self == other :
399407 return False
You can’t perform that action at this time.
0 commit comments