From 702a73452059ce4e97cda011e09dc4ef2a7b9dec Mon Sep 17 00:00:00 2001 From: angie Date: Sun, 6 Aug 2023 13:05:04 -0400 Subject: [PATCH] fix mypy --- src/mapfile_parser/mapfile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mapfile_parser/mapfile.py b/src/mapfile_parser/mapfile.py index 57f5b5c..fb8cb2a 100644 --- a/src/mapfile_parser/mapfile.py +++ b/src/mapfile_parser/mapfile.py @@ -7,7 +7,7 @@ import dataclasses import re -from typing import Generator +from typing import Any, Generator from pathlib import Path from .progress_stats import ProgressStats @@ -60,8 +60,8 @@ def printAsCsv(self): print(f"{self.name},{self.vram:08X},{self.size}") - def toJson(self) -> dict: - result = { + def toJson(self) -> dict[str, Any]: + result: dict[str, Any] = { "name": self.name, "vram": self.getVramStr(), "size": self.serializeSize(), @@ -178,8 +178,8 @@ def printAsCsv(self, printVram: bool=True): print(f"{self.filepath},{self.segmentType},{symCount},{maxSize},{self.size},{averageSize:0.2f}") - def toJson(self) -> dict: - fileDict = { + def toJson(self) -> dict[str, Any]: + fileDict: dict[str, Any] = { "filepath": str(self.filepath), "segmentType": self.segmentType, "vram": self.serializeVram(), @@ -524,13 +524,13 @@ def printSymbolsCsv(self): return - def toJson(self) -> dict: + def toJson(self) -> dict[str, Any]: filesList = [] for file in self.filesList: filesList.append(file.toJson()) - result = { + result: dict[str, Any] = { "files": filesList } return result