Skip to content

Commit

Permalink
docs: TYPE_CHECKING for injected types (#3502)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibor-reiss authored May 16, 2024
1 parent 5cb2d85 commit bfb4a0f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/usage/dependency-injection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ the application:
The above example illustrates how dependencies are declared on the different layers of the application.

.. note::

Litestar needs the injected types at runtime which might clash with linter rules' recommendation to use ``TYPE_CHECKING``.

.. seealso::

:ref:`Signature namespace <signature_namespace>`

Dependencies can be either callables - sync or async functions, methods, or class instances that implement the
:meth:`object.__call__` method, or classes. These are in turn wrapped inside an instance of the
:class:`Provide <.di.Provide>` class.
Expand Down

0 comments on commit bfb4a0f

Please sign in to comment.