Game now supports __str__
This commit is contained in:
1 parent
acdc7458f1
commit
8100a50fbe
1 file changed
+3
@@ -14,6 +14,9 @@ class Game:
|
|||||||
self.id: int = int(data["id"])
|
self.id: int = int(data["id"])
|
||||||
self.name: str = data["name"]
|
self.name: str = data["name"]
|
||||||
|
|
||||||
|
def __str__(self) -> str:
|
||||||
|
return self.name
|
||||||
|
|
||||||
def __eq__(self, other: object):
|
def __eq__(self, other: object):
|
||||||
if isinstance(other, self.__class__):
|
if isinstance(other, self.__class__):
|
||||||
return self.id == other.id
|
return self.id == other.id
|
||||||
|
|||||||
Reference in new issue
Block a user