删除了不常用的内容, 并使得Config能与3.10兼容
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user