In a deployment script, compare a Schedule on the server to a proposed Schedule, and skip schedule updates as needed.
Describe the bug
When comparing two Schedules that differ only in their ScheduleOverlapPolicy, Schedule.__eq__ returns true.
This seems to be caused by ScheduleOverlapPolicy, where every enum case apparently equals to any cases according to ScheduleOverlapPolicy.__eq__, even though the underlying values are different.
For some reason, ScheduleOverlapPolicy is both a dataclass and an IntEnum. Seems like the rare combination might have caused the behaviour here?
What are you really trying to do?
In a deployment script, compare a
Schedule
on the server to a proposedSchedule
, and skip schedule updates as needed.Describe the bug
When comparing two
Schedule
s that differ only in theirScheduleOverlapPolicy
,Schedule.__eq__
returns true.This seems to be caused by
ScheduleOverlapPolicy
, where every enum case apparently equals to any cases according toScheduleOverlapPolicy.__eq__
, even though the underlying values are different.For some reason,
ScheduleOverlapPolicy
is both a dataclass and an IntEnum. Seems like the rare combination might have caused the behaviour here?Minimal Reproduction
Environment/Versions
Python 3.11.7
Additional context