nebius/SWE-bench-extra huggingface dataset:
Repository: collective/icalendar

Issue:
Missing equivalence member function for icalendar.prop.vDDDTypes
While comparing two vevents, I have to check if RECURRENCE-ID are the same in addition to UID.
However, `vevent1["RECURRENCE-ID"]==vevent2["RECURRENCE-ID"] `always returns false, as only the object ids are compared and not the content.

It would be helpful if `icalendar.prop.vDDDTypes` would implement `__eq__(self, other)`.



Comments:

Patch:
diff --git a/src/icalendar/prop.py b/src/icalendar/prop.py
index b6395df..36d2b94 100644
--- a/src/icalendar/prop.py
+++ b/src/icalendar/prop.py
@@ -323,6 +323,11 @@ class vDDDTypes:
         else:
             raise ValueError(f'Unknown date type: {type(dt)}')
 
+    def __eq__(self, other):
+        if isinstance(other, vDDDTypes):
+            return self.params == other.params
+        return False
+
     @classmethod
     def from_ical(cls, ical, timezone=None):
         if isinstance(ical, cls):


Test patch:
diff --git a/src/icalendar/tests/test_unit_prop.py b/src/icalendar/tests/test_unit_prop.py
index acfc788..0549320 100644
--- a/src/icalendar/tests/test_unit_prop.py
+++ b/src/icalendar/tests/test_unit_prop.py
@@ -112,6 +112,27 @@ class TestProp(unittest.TestCase):
         # Bad input
         self.assertRaises(ValueError, vDDDTypes, 42)
 
+    def test_vDDDTypes_equivalance(self):
+        from ..prop import vDDDTypes
+        from copy import deepcopy
+
+        vDDDTypes = [
+                vDDDTypes(pytz.timezone('US/Eastern').localize(datetime(year=2022, month=7, day=22, hour=12, minute=7))),
+                vDDDTypes(datetime(year=2022, month=7, day=22, hour=12, minute=7)),
+                vDDDTypes(date(year=2022, month=7, day=22)),
+                vDDDTypes(time(hour=22, minute=7, second=2))]
+
+        for v_type in vDDDTypes:
+            self.assertEqual(v_type, deepcopy(v_type))
+            for other in vDDDTypes:
+                if other is v_type:
+                    continue
+                self.assertNotEqual(v_type, other)
+
+            # see if equivalnce fails for other types
+            self.assertNotEqual(v_type, 42)
+            self.assertNotEqual(v_type, 'test')
+
     def test_prop_vDate(self):
         from ..prop import vDate