python-injection 0.10.10__tar.gz → 0.10.11__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {python_injection-0.10.10 → python_injection-0.10.11}/PKG-INFO +1 -1
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/module.py +4 -3
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/integrations/fastapi.py +3 -5
- {python_injection-0.10.10 → python_injection-0.10.11}/pyproject.toml +1 -1
- {python_injection-0.10.10 → python_injection-0.10.11}/README.md +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/__init__.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/__init__.pyi +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/__init__.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/__init__.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/event.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/invertible.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/lazy.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/threading.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/type.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/hook.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/exceptions.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/integrations/__init__.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/integrations/blacksheep.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/py.typed +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/testing/__init__.py +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/testing/__init__.pyi +0 -0
- {python_injection-0.10.10 → python_injection-0.10.11}/injection/utils.py +0 -0
@@ -514,9 +514,10 @@ class Module(Broker, EventListener):
|
|
514
514
|
mode: Mode | ModeStr = Mode.get_default(),
|
515
515
|
):
|
516
516
|
def decorator(wp): # type: ignore[no-untyped-def]
|
517
|
-
|
518
|
-
self.
|
519
|
-
|
517
|
+
lazy_instance = Lazy(wp)
|
518
|
+
self.injectable(
|
519
|
+
lambda: ~lazy_instance,
|
520
|
+
inject=False,
|
520
521
|
on=on,
|
521
522
|
mode=mode,
|
522
523
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from collections.abc import Callable
|
2
2
|
from types import GenericAlias
|
3
|
-
from typing import Any, ClassVar,
|
3
|
+
from typing import Any, ClassVar, TypeAliasType
|
4
4
|
|
5
5
|
from injection import Module, mod
|
6
6
|
from injection.exceptions import InjectionError
|
@@ -52,10 +52,8 @@ class InjectionDependency[T]:
|
|
52
52
|
return hash(self.__key)
|
53
53
|
|
54
54
|
@property
|
55
|
-
def __key(
|
56
|
-
self,
|
57
|
-
) -> tuple[type[Self], type[T] | TypeAliasType | GenericAlias, Module]:
|
58
|
-
return type(self), self.__class, self.__module
|
55
|
+
def __key(self) -> tuple[type[T] | TypeAliasType | GenericAlias, Module]:
|
56
|
+
return self.__class, self.__module
|
59
57
|
|
60
58
|
def __ensure(self, instance: T | Any) -> T:
|
61
59
|
if instance is self.__sentinel:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|