From fd09b381a629d00617d711bc4a90b18abd095465 Mon Sep 17 00:00:00 2001 From: Thomas Lindner Date: Sat, 18 Mar 2023 18:42:59 +0100 Subject: [PATCH] [misc] Add some type annotations --- backend/setup.cfg | 3 ++- backend/src/kibicara/platformapi.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/setup.cfg b/backend/setup.cfg index 5029c6e..e56d0f7 100644 --- a/backend/setup.cfg +++ b/backend/setup.cfg @@ -53,11 +53,12 @@ deps = black flake8 mypy + types-requests commands = black -S --check --diff src tests flake8 src tests # not yet - #mypy src tests + #mypy --ignore-missing-imports src tests [testenv] deps = diff --git a/backend/src/kibicara/platformapi.py b/backend/src/kibicara/platformapi.py index 0d81c06..f0ef4f2 100644 --- a/backend/src/kibicara/platformapi.py +++ b/backend/src/kibicara/platformapi.py @@ -1,4 +1,4 @@ -# Copyright (C) 2020 by Thomas Lindner +# Copyright (C) 2020, 2023 by Thomas Lindner # Copyright (C) 2020 by Cathy Hu # Copyright (C) 2020 by Martin Rey # @@ -71,7 +71,7 @@ class Censor: hood (Hood): A Hood Model object """ - __instances = {} + __instances: dict[int, list["Censor"]] = {} def __init__(self, hood): self.hood = hood @@ -177,7 +177,7 @@ class Spawner: BotClass (Censor subclass): A Bot Class object """ - __instances = [] + __instances: list["Spawner"] = [] def __init__(self, ORMClass, BotClass): self.ORMClass = ORMClass