From c34b7856a4757620b3fbe1421eb04879f1fa17ab Mon Sep 17 00:00:00 2001 From: LDericher <40151420+ldericher@users.noreply.github.com> Date: Mon, 9 Aug 2021 06:47:59 +0200 Subject: [PATCH] better inheritance --- fftcg/cards.py | 4 +--- fftcg/imageloader.py | 2 +- fftcg/opus.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/fftcg/cards.py b/fftcg/cards.py index b4dcb8a..da609ad 100644 --- a/fftcg/cards.py +++ b/fftcg/cards.py @@ -7,8 +7,6 @@ class Cards(list[Card]): __API_URL = "https://fftcg.square-enix-games.com/de/get-cards" def __init__(self, params: dict[str, any]): - list.__init__(self) - # required params: # text # supported params: @@ -20,7 +18,7 @@ class Cards(list[Card]): params["text"] = "" req = requests.post(Cards.__API_URL, json=params) - self.extend([Card(card_data) for card_data in req.json()["cards"]]) + super().__init__([Card(card_data) for card_data in req.json()["cards"]]) def __str__(self) -> str: return "\n".join(str(card) for card in self) diff --git a/fftcg/imageloader.py b/fftcg/imageloader.py index dff2226..a836152 100644 --- a/fftcg/imageloader.py +++ b/fftcg/imageloader.py @@ -9,7 +9,7 @@ from PIL import Image class ImageLoader(threading.Thread): def __init__(self, url_queue: queue.Queue, resolution: tuple[int, int], language: str): - threading.Thread.__init__(self) + super().__init__() self.__queue = url_queue self.__resolution = resolution diff --git a/fftcg/opus.py b/fftcg/opus.py index 24a61a1..3144d20 100644 --- a/fftcg/opus.py +++ b/fftcg/opus.py @@ -30,7 +30,7 @@ class Opus(Cards): self.__number = "?" self.__name = "?" - Cards.__init__(self, params) + super().__init__(params) # remove reprints for card in self: