We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acb4494 commit 4fd714fCopy full SHA for 4fd714f
1 file changed
cchess/__init__.py
@@ -568,7 +568,7 @@ def from_unicode(cls, unicode: str):
568
return cls.from_symbol(UNICODE_TO_PIECE_SYMBOLS[unicode])
569
570
571
-@dataclasses.dataclass(unsafe_hash=True)
+@dataclasses.dataclass
572
class Move:
573
def __init__(self, from_square: Square, to_square: Square):
574
assert from_square in SQUARES, f"from_square out of range: {from_square!r}"
@@ -614,6 +614,9 @@ def __bool__(self):
614
def null(cls):
615
return cls(0, 0)
616
617
+ def __hash__(self):
618
+ return hash((self.from_square, self.to_square))
619
+
620
621
class BaseBoard:
622
def __init__(self, board_fen: Optional[str] = STARTING_BOARD_FEN):
0 commit comments