From 8100a50fbe0973d00909403f73cf70ab07b1ee36 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Mon, 20 Dec 2021 21:30:47 +0100 Subject: [PATCH] Game now supports __str__ --- inventory.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inventory.py b/inventory.py index ec46f5a..659209a 100644 --- a/inventory.py +++ b/inventory.py @@ -14,6 +14,9 @@ class Game: self.id: int = int(data["id"]) self.name: str = data["name"] + def __str__(self) -> str: + return self.name + def __eq__(self, other: object): if isinstance(other, self.__class__): return self.id == other.id