File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ classifiers = [
2323]
2424dependencies = [
2525 " httpx>=0.28" ,
26+ " typing-extensions>=4.15.0; python_version < '3.11'" ,
2627]
2728
2829[project .scripts ]
Original file line number Diff line number Diff line change 1212import time
1313from collections .abc import Callable
1414from json import dumps
15+ from sys import version_info
1516from typing import Any
1617from urllib .parse import urlparse , urlunparse
1718
1819from .exceptions import SwgohComlinkValueError
1920from .helpers import Constants
2021
22+ if version_info >= (3 , 11 ):
23+ from typing import Self
24+ else :
25+ from typing_extensions import Self
26+
2127__all__ = ["SwgohComlinkBase" ]
2228
2329# Keys whose values must be masked in logs, repr, and debug output.
@@ -92,11 +98,11 @@ def __repr__(self) -> str:
9298 f"secret_key={ self ._mask (self .secret_key )!r} )"
9399 )
94100
95- def __new__ (cls , * args : Any , ** kwargs : Any ) -> SwgohComlinkBase :
101+ def __new__ (cls , * args : Any , ** kwargs : Any ) -> Self :
96102 """Prevent instances of this base class from being created directly."""
97103 if cls is SwgohComlinkBase :
98104 raise TypeError (f"Only subclasses of '{ cls .__name__ } ' may be instantiated." )
99- return object .__new__ (cls )
105+ return super () .__new__ (cls )
100106
101107 def __init__ (
102108 self ,
You can’t perform that action at this time.
0 commit comments