Skip to content

v1.4.0

Choose a tag to compare

@amyasnikov amyasnikov released this 18 Mar 16:10
· 3 commits to master since this release

New Features:

  • di.inject now explicitly sets __signature__ attribute of the underlying func. This new signature contains all the original function params except those having Annotated[...] type hint.

Example:

@di.inject
def func(p1: int, p2: Annnotated[str, some_dependency]): ...

assert inspect.signature(func).parameters.keys() == {"p1"}