Skip to content

Commit

Permalink
Add display methods to GameNodeComment
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkZH committed Feb 23, 2024
1 parent 54e044a commit aa47f1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chess/pgn.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ def __eq__(self, other: object) -> bool:
else:
return False

def __repr__(self) -> str:
return f"{self.__class__.__name__}({self._comments})"

def __str__(self) -> str:
return self.pgn_format()


class GameNode(abc.ABC):
parent: Optional[GameNode]
Expand Down

0 comments on commit aa47f1e

Please sign in to comment.