remove Self references in shared code (as it is py3.11 only)
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 17 May 2023 20:02:24 +0000 (22:02 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 17 May 2023 20:02:24 +0000 (22:02 +0200)
music_assistant/common/models/config_entries.py
music_assistant/common/models/enums.py
music_assistant/common/models/media_items.py

index ab2bdd2d2ac2ef9290a5f9ae4b6456f9d5e89d5d..1839da2575ce03c7472da33b0f76cb0b847b23c5 100644 (file)
@@ -5,7 +5,7 @@ import logging
 from collections.abc import Iterable
 from dataclasses import dataclass
 from types import NoneType
-from typing import Any, Self
+from typing import Any
 
 from mashumaro import DataClassDictMixin
 
@@ -157,10 +157,10 @@ class Config(DataClassDictMixin):
 
     @classmethod
     def parse(
-        cls: Self,
+        cls,
         config_entries: Iterable[ConfigEntry],
         raw: dict[str, Any],
-    ) -> Self:
+    ) -> Config:
         """Parse Config from the raw values (as stored in persistent storage)."""
         conf = cls.from_dict({**raw, "values": {}})
         for entry in config_entries:
index 17c65f2c7755dedac6c3be10884ebe73b1344cf3..98a06973184066d0e56952cdbd2d5e2798bf504f 100644 (file)
@@ -2,7 +2,7 @@
 from __future__ import annotations
 
 from enum import Enum
-from typing import Any, Self, TypeVar
+from typing import Any, TypeVar
 
 # pylint:disable=ungrouped-imports
 try:
@@ -51,7 +51,7 @@ class MediaType(StrEnum):
 
     @classmethod
     @property
-    def ALL(cls: Self) -> tuple[MediaType, ...]:  # noqa: N802
+    def ALL(cls) -> tuple[MediaType, ...]:  # noqa: N802
         """Return all (default) MediaTypes as tuple."""
         return (
             MediaType.ARTIST,
index 3aee5f78d601787c731886d97b934132e1de409e..55f1b1933becb45e47fdaf90201ba688921d66c5 100755 (executable)
@@ -4,7 +4,7 @@ from __future__ import annotations
 from collections.abc import Mapping
 from dataclasses import dataclass, field, fields
 from time import time
-from typing import Any, Self
+from typing import Any
 
 from mashumaro import DataClassDictMixin
 
@@ -474,7 +474,7 @@ class PagedItems(DataClassDictMixin):
     total: int | None = None
 
     @classmethod
-    def parse(cls: Self, raw: dict[str, Any], item_type: type) -> PagedItems:
+    def parse(cls, raw: dict[str, Any], item_type: type) -> PagedItems:
         """Parse PagedItems object including correct item type."""
         return PagedItems(
             items=[item_type.from_dict(x) for x in raw["items"]],