From db4091f41fc232d0d9e968d895612048ab82909f Mon Sep 17 00:00:00 2001 From: Trysdyn Black Date: Sun, 6 Oct 2024 18:59:19 -0700 Subject: [PATCH] Make pyright shut up about dicts Apparently if you create a dict with pre-populated data, pyright infers the dict's types for type checking purposes, and this can be wrong here where my data dicts are massive sprawling affairs of dynamic info. The right thing to do is probably turn this into a class, but for now I'll just split the dicts pyright complains about up differently. --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 4b92d47..2f2e51d 100644 --- a/main.py +++ b/main.py @@ -10,7 +10,9 @@ import sys def parse_MONSTERS(data): result = {} for m_text in data.split("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"): - info = {"stats": {}, "spells": {}} + info = {} + info["stats"] = {} + info["spells"] = {} name = "NULL" for line in m_text.split("\n"): # Name and level