From cbc57e761196a1102ced01d23add1e706c3a360a Mon Sep 17 00:00:00 2001 From: LDericher <40151420+ldericher@users.noreply.github.com> Date: Mon, 23 Aug 2021 16:47:11 +0200 Subject: [PATCH] __repr__ implementations --- fftcg/card.py | 3 +++ fftcg/code.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fftcg/card.py b/fftcg/card.py index e8d6009..106542b 100644 --- a/fftcg/card.py +++ b/fftcg/card.py @@ -73,6 +73,9 @@ class Card: text=text, ) + def __repr__(self) -> str: + return f"Card(code={self.code!r}, name={self.name!r}, face_url={self.face_url!r})" + def __str__(self) -> str: return f"'{self.__name}' ({'/'.join(self.__elements)}, {self.code})" diff --git a/fftcg/code.py b/fftcg/code.py index e5af13d..08265ee 100644 --- a/fftcg/code.py +++ b/fftcg/code.py @@ -35,7 +35,7 @@ class Code: return f"{self.__opus}-{self.__serial}{self.__rarity}" def __repr__(self) -> str: - return f"Code(\"{str(self)}\")" + return f"Code({str(self)!r})" def __hash__(self) -> hash: return hash(self.short)