Skip to content

Commit 8bea9fe

Browse files
authored
Improve typing of inject (#57)
1 parent 875352e commit 8bea9fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rodi/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ def __contains__(self, item) -> bool:
4545
AliasesTypeHint = dict[str, Type]
4646

4747

48-
def inject(globalsns=None, localns=None) -> Callable[..., Any]:
48+
def inject(
49+
globalsns: Optional[Dict[str, Any]] = None,
50+
localns: Optional[Dict[str, Any]] = None,
51+
) -> Callable[[T], T]:
4952
"""
5053
Marks a class or a function as injected. This method is only necessary if the class
5154
uses locals and the user uses Python >= 3.10, to bind the function's locals to the

0 commit comments

Comments
 (0)