aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-07-10 21:41:42 +0100
committerGravatar Chris Lovering <[email protected]>2022-07-10 21:41:42 +0100
commit9cc928e214f9a069ab41ad0da5d803e58f1e2329 (patch)
tree79316133d71ac5caf3895d241c78faa37eecc41e
parentUpdate staff category list, and add another ignored category (diff)
Update 3.9-style type hints in config.py
-rw-r--r--metricity/config.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/metricity/config.py b/metricity/config.py
index 5a57d59..2081980 100644
--- a/metricity/config.py
+++ b/metricity/config.py
@@ -2,7 +2,7 @@
import logging
from os import environ
from pathlib import Path
-from typing import Any, Dict, List, Optional, Tuple
+from typing import Any, Optional
import toml
from deepmerge import Merger
@@ -17,7 +17,7 @@ class MetricityConfigurationError(Exception):
"""Exception signifying something has gone awry whilst parsing Metricity config."""
-def get_section(section: str) -> Dict[str, Any]:
+def get_section(section: str) -> dict[str, Any]:
"""
Load the section config from config-default.toml and config.toml.
@@ -64,8 +64,8 @@ class ConfigSection(type):
def __new__(
cls: type,
name: str,
- bases: Tuple[type],
- dictionary: Dict[str, Any]
+ bases: tuple[type],
+ dictionary: dict[str, Any]
) -> type:
"""Use the section attr in the subclass to fill in the values from the TOML."""
config = get_section(dictionary["section"])
@@ -114,8 +114,8 @@ class BotConfig(metaclass=ConfigSection):
guild_id: int
staff_role_id: int
- staff_categories: List[int]
- ignore_categories: List[int]
+ staff_categories: list[int]
+ ignore_categories: list[int]
class DatabaseConfig(metaclass=ConfigSection):