Skip to content

[Bug] Components not necessarily equal #1224

@niccokunzmann

Description

@niccokunzmann

Describe the bug

It can be that equality depends on the order of equality.

To reproduce

>>> from icalendar import Calendar, Event
>>> calendar1 = Calendar()
>>> calendar2 = Calendar()
>>> calendar1.subcomponents = [event1, event2]
>>> calendar2.subcomponents = [event1, event1]
>>> calendar1 == calendar2
False
>>> calendar2 == calendar1
True

Expected behavior

False always

Environment

  • Operating system: Linux
  • Python version: 3.13
  • icalendar version: 7.0.1

Additional context

  • The tests for this should be in test_equality.
  • Make sure we have a linear run time where possible.
  • Please test this with the calendars and then also the deep copy .copy(recursive=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions