Skip to content

Commit bfb4a0f

Browse files
authored
docs: TYPE_CHECKING for injected types (#3502)
1 parent 5cb2d85 commit bfb4a0f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/usage/dependency-injection.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ the application:
5353
5454
The above example illustrates how dependencies are declared on the different layers of the application.
5555

56+
.. note::
57+
58+
Litestar needs the injected types at runtime which might clash with linter rules' recommendation to use ``TYPE_CHECKING``.
59+
60+
.. seealso::
61+
62+
:ref:`Signature namespace <signature_namespace>`
63+
5664
Dependencies can be either callables - sync or async functions, methods, or class instances that implement the
5765
:meth:`object.__call__` method, or classes. These are in turn wrapped inside an instance of the
5866
:class:`Provide <.di.Provide>` class.

0 commit comments

Comments
 (0)