Skip to content

Commit

Permalink
Define Constraint to be Hashable as well
Browse files Browse the repository at this point in the history
For LRU cache.
  • Loading branch information
amolenaar committed Jul 9, 2021
1 parent 5f9f717 commit 99d90ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gaphas/solver/constraint.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from __future__ import annotations

from typing import Callable, Collection, Set
from typing import Callable, Collection, Hashable, Set

from typing_extensions import Protocol, runtime_checkable

from gaphas.solver.variable import Variable


@runtime_checkable
class Constraint(Protocol):
class Constraint(Protocol, Hashable):
def add_handler(self, handler: Callable[[Constraint], None]) -> None:
...

Expand Down

0 comments on commit 99d90ac

Please sign in to comment.