Skip to content

Commit

Permalink
Add some __eq__
Browse files Browse the repository at this point in the history
Needed as 088eea7 adds comparison of elements this makes sure that they
are compared by value instead of by reference.
  • Loading branch information
jspricke committed Oct 9, 2023
1 parent 974d511 commit 759f983
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Bug fixes:
[jacadzaca]
- Use non legacy timezone name.
Ref: #567
- Add some compare functions.
Ref: #568

5.0.10 (unreleased)
-------------------
Expand Down
10 changes: 10 additions & 0 deletions src/icalendar/prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ def from_ical(ical, timezone=None):
out.append(vDDDTypes.from_ical(ical_dt, timezone=timezone))
return out

def __eq__(self, other):
if not isinstance(other, vDDDLists):
return False
return self.dts == other.dts


class vCategory:

Expand Down Expand Up @@ -865,6 +870,11 @@ def from_ical(cls, ical):
return -offset
return offset

def __eq__(self, other):
if not isinstance(other, vUTCOffset):
return False
return self.td == other.td


class vInline(str):
"""This is an especially dumb class that just holds raw unparsed text and
Expand Down

0 comments on commit 759f983

Please sign in to comment.