Skip to content

Commit

Permalink
Implement __eq__ for Task.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanAlbert committed Dec 22, 2023
1 parent cf0b109 commit 1092fc4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dcs/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def dict(self) -> TaskDict:
"number": self.number
}

def __eq__(self, other: Any) -> bool:
if not isinstance(other, Task):
return False
return self.dict() == other.dict()


class ControlledTask(Task):
"""A ControlledTask is a task action with start and stop conditions.
Expand Down

0 comments on commit 1092fc4

Please sign in to comment.