@@ -19,27 +19,42 @@ from ._core.common.type import TypeInfo as _TypeInfo
1919from ._core .module import InjectableFactory as _InjectableFactory
2020from ._core .module import ModeStr , PriorityStr
2121
22- _ : Module = ...
22+ __module : Module = ...
2323
24- afind_instance = _ .afind_instance
25- aget_instance = _ .aget_instance
26- aget_lazy_instance = _ .aget_lazy_instance
27- constant = _ .constant
28- find_instance = _ .find_instance
29- get_instance = _ .get_instance
30- get_lazy_instance = _ .get_lazy_instance
31- inject = _ .inject
32- injectable = _ .injectable
33- set_constant = _ .set_constant
34- should_be_injectable = _ .should_be_injectable
35- singleton = _ .singleton
36-
37- del _
24+ afind_instance = __module .afind_instance
25+ aget_instance = __module .aget_instance
26+ aget_lazy_instance = __module .aget_lazy_instance
27+ constant = __module .constant
28+ find_instance = __module .find_instance
29+ get_instance = __module .get_instance
30+ get_lazy_instance = __module .get_lazy_instance
31+ inject = __module .inject
32+ injectable = __module .injectable
33+ set_constant = __module .set_constant
34+ should_be_injectable = __module .should_be_injectable
35+ singleton = __module .singleton
3836
3937def mod (name : str = ..., / ) -> Module :
4038 """
4139 Short syntax for `Module.from_name`.
4240 """
41+ @runtime_checkable
42+ class Injectable [T ](Protocol ):
43+ @property
44+ def is_locked (self ) -> bool : ...
45+ def unlock (self ) -> None : ...
46+ @abstractmethod
47+ async def aget_instance (self ) -> T : ...
48+ @abstractmethod
49+ def get_instance (self ) -> T : ...
50+
51+ class LazyInstance [T ]:
52+ def __init__ (self , cls : _InputType [T ], module : Module = ...) -> None : ...
53+ @overload
54+ def __get__ (self , instance : object , owner : type | None = ...) -> T : ...
55+ @overload
56+ def __get__ (self , instance : None = ..., owner : type | None = ...) -> Self : ...
57+
4358@final
4459class Module :
4560 """
@@ -275,30 +290,13 @@ class Module:
275290 Class method for getting the default module.
276291 """
277292
278- @final
279- class Priority (Enum ):
280- LOW = ...
281- HIGH = ...
282-
283- @runtime_checkable
284- class Injectable [T ](Protocol ):
285- @property
286- def is_locked (self ) -> bool : ...
287- def unlock (self ) -> None : ...
288- @abstractmethod
289- async def aget_instance (self ) -> T : ...
290- @abstractmethod
291- def get_instance (self ) -> T : ...
292-
293293@final
294294class Mode (Enum ):
295295 FALLBACK = ...
296296 NORMAL = ...
297297 OVERRIDE = ...
298298
299- class LazyInstance [T ]:
300- def __init__ (self , cls : _InputType [T ], module : Module = ...) -> None : ...
301- @overload
302- def __get__ (self , instance : object , owner : type | None = ...) -> T : ...
303- @overload
304- def __get__ (self , instance : None = ..., owner : type | None = ...) -> Self : ...
299+ @final
300+ class Priority (Enum ):
301+ LOW = ...
302+ HIGH = ...
0 commit comments