Skip to content

Commit

Permalink
Expand call_with_injection() documentation (#233)
Browse files Browse the repository at this point in the history
I thought it could use some clarifications.
  • Loading branch information
jstasiak authored Sep 11, 2023
1 parent db332ec commit 395e7e8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions injector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,14 @@ def call_with_injection(
) -> T:
"""Call a callable and provide its dependencies if needed.
Dependencies are provided when the callable is decorated with :func:`@inject <inject>`
or some individual parameters are wrapped in :data:`Inject` – otherwise
``call_with_injection()`` is equivalent to just calling the callable directly.
If there is an overlap between arguments provided in ``args`` and ``kwargs``
and injectable dependencies the provided values take precedence and no dependency
injection process will take place for the corresponding parameters.
:param self_: Instance of a class callable belongs to if it's a method,
None otherwise.
:param args: Arguments to pass to callable.
Expand Down

0 comments on commit 395e7e8

Please sign in to comment.