删除了不常用的内容, 并使得Config能与3.10兼容

This commit is contained in:
2025-12-21 04:22:14 +08:00
parent efd826f677
commit 058975c37d
4 changed files with 33 additions and 89 deletions

View File

@@ -34,14 +34,14 @@ class SingletonModel[T](IModel):
_InjectInstances:Dict[type,Any] = {}
@staticmethod
def GetInstance(t:Typen[T]) -> T:
def GetInstance(t:type) -> T:
return SingletonModel._InjectInstances[t]
@staticmethod
def SetInstance(t:Typen[T], obj:T) -> None:
def SetInstance(t:type, obj:T) -> None:
SingletonModel._InjectInstances[t] = obj
def __init__(self, t:Typen[T]) -> None:
def __init__(self, t:type) -> None:
self.typen: type = t
@@ -140,7 +140,7 @@ class Architecture:
return type_ in cls._RegisteredObjects
@classmethod
def Get[T](cls, type_:Typen[T]) -> T:
def Get(cls, type_:type) -> Any:
return cls._RegisteredObjects[type_]
@classmethod