Skip to content

Commit

Permalink
add vPeriod,__eq__
Browse files Browse the repository at this point in the history
  • Loading branch information
jacadzaca committed Sep 30, 2023
1 parent 1b44560 commit f359682
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/icalendar/prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@ def __cmp__(self, other):
f'Cannot compare vPeriod with {other!r}')
return cmp((self.start, self.end), (other.start, other.end))

def __eq__(self, other):
if not isinstance(other, vPeriod):
return False
return (self.start, self.end) == (other.start, other.end)

def overlaps(self, other):
if self.start > other.start:
return other.overlaps(self)
Expand Down

0 comments on commit f359682

Please sign in to comment.