From fae6125ca1ca872ca8c65e81312b418beb4f6ca5 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sat, 30 Sep 2023 19:30:01 +0800 Subject: [PATCH] :bug: Fix typo --- simnet/errors.py | 2 +- simnet/models/genshin/chronicle/stats.py | 2 +- simnet/models/starrail/chronicle/activity.py | 4 ++-- simnet/models/starrail/chronicle/resident.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/simnet/errors.py b/simnet/errors.py index 1c4941b..85497ef 100644 --- a/simnet/errors.py +++ b/simnet/errors.py @@ -60,7 +60,7 @@ class BadRequest(SIMNetException): return f"{type(self).__name__}({repr(response)})" @property - def response(self) -> dict[str, Union[str, Any, None]]: + def response(self) -> Dict[str, Union[str, Any, None]]: return {"retcode": self.ret_code, "message": self.original} @property diff --git a/simnet/models/genshin/chronicle/stats.py b/simnet/models/genshin/chronicle/stats.py index c51f6a5..d92ff05 100644 --- a/simnet/models/genshin/chronicle/stats.py +++ b/simnet/models/genshin/chronicle/stats.py @@ -198,7 +198,7 @@ class PartialGenshinUserStats(APIModel): if not v: return None if isinstance(v, dict): - return cast("dict[str, Any]", v) + return cast("Dict[str, Any]", v) return {**v[0], "realms": v} diff --git a/simnet/models/starrail/chronicle/activity.py b/simnet/models/starrail/chronicle/activity.py index 8ec4d64..1d03656 100644 --- a/simnet/models/starrail/chronicle/activity.py +++ b/simnet/models/starrail/chronicle/activity.py @@ -1,5 +1,5 @@ """Starrail chronicle activity.""" -from typing import List, Optional +from typing import List, Optional, Dict from simnet.models.base import APIModel from simnet.models.starrail.character import ActivityCharacter @@ -139,7 +139,7 @@ class StarRailActivity(APIModel): activities: List - def find_activity(self, key: str) -> Optional[dict]: + def find_activity(self, key: str) -> Optional[Dict]: """Find an activity by key.""" for activity in self.activities: if list(activity.keys())[0] == key: diff --git a/simnet/models/starrail/chronicle/resident.py b/simnet/models/starrail/chronicle/resident.py index 53e95f1..a88c2a5 100644 --- a/simnet/models/starrail/chronicle/resident.py +++ b/simnet/models/starrail/chronicle/resident.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Optional, Dict from simnet.models.base import APIModel @@ -50,7 +50,7 @@ class StarRailResident(APIModel): residents: List - def find_resident(self, key: str) -> Optional[dict]: + def find_resident(self, key: str) -> Optional[Dict]: """Find a resident by key.""" for resident in self.residents: if list(resident.keys())[0] == key: