Injectinator 0.4.0__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {injectinator-0.4.0 → injectinator-0.4.2}/PKG-INFO +1 -1
- {injectinator-0.4.0 → injectinator-0.4.2}/pyproject.toml +1 -1
- {injectinator-0.4.0 → injectinator-0.4.2}/src/Injectinator.egg-info/PKG-INFO +1 -1
- {injectinator-0.4.0 → injectinator-0.4.2}/src/injectinator/__init__.py +3 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/src/injectinator/typed.py +3 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/README.md +0 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/setup.cfg +0 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/src/Injectinator.egg-info/SOURCES.txt +0 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/src/Injectinator.egg-info/dependency_links.txt +0 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/src/Injectinator.egg-info/top_level.txt +0 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/src/injectinator/py.typed +0 -0
- {injectinator-0.4.0 → injectinator-0.4.2}/tests/test_inject.py +0 -0
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import functools # This is only needed for debugging, you can remove
|
|
2
2
|
|
|
3
3
|
def injectinator(func):
|
|
4
|
+
"""
|
|
5
|
+
Very simple dependency injection wrapper that supplies concrete instances of specified class definitions from a functions specification
|
|
6
|
+
"""
|
|
4
7
|
@functools.wraps(func) # This is only needed for debugging, you can remove
|
|
5
8
|
def wrapper(*args, **kwargs):
|
|
6
9
|
replacements = dict(zip(
|
|
@@ -5,6 +5,9 @@ P = ParamSpec("P")
|
|
|
5
5
|
R = TypeVar("R")
|
|
6
6
|
|
|
7
7
|
def injectinator(func: Callable[P, R]) -> Callable[P, R]:
|
|
8
|
+
"""
|
|
9
|
+
Very simple dependency injection wrapper that supplies concrete instances of specified class definitions from a functions specification
|
|
10
|
+
"""
|
|
8
11
|
@functools.wraps(func) # This is only needed for debugging, you can remove
|
|
9
12
|
def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
|
|
10
13
|
replacements = dict(zip(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|