1
0
Fork 0
mirror of https://github.com/ldericher/fftcgtool synced 2025-01-15 23:03:00 +00:00

__repr__ implementations

This commit is contained in:
Jörn-Michael Miehe 2021-08-23 16:47:11 +02:00
parent 938a10c807
commit cbc57e7611
2 changed files with 4 additions and 1 deletions

View file

@ -73,6 +73,9 @@ class Card:
text=text, 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: def __str__(self) -> str:
return f"'{self.__name}' ({'/'.join(self.__elements)}, {self.code})" return f"'{self.__name}' ({'/'.join(self.__elements)}, {self.code})"

View file

@ -35,7 +35,7 @@ class Code:
return f"{self.__opus}-{self.__serial}{self.__rarity}" return f"{self.__opus}-{self.__serial}{self.__rarity}"
def __repr__(self) -> str: def __repr__(self) -> str:
return f"Code(\"{str(self)}\")" return f"Code({str(self)!r})"
def __hash__(self) -> hash: def __hash__(self) -> hash:
return hash(self.short) return hash(self.short)