2020-09-02 01:39:23 +00:00
|
|
|
List provider
|
|
|
|
-------------
|
|
|
|
|
|
|
|
.. meta::
|
|
|
|
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,List,Injection
|
|
|
|
:description: List provider helps to inject a list of the dependencies. This page demonstrates
|
|
|
|
how to use a List provider.
|
2020-06-14 21:32:12 +00:00
|
|
|
|
|
|
|
.. currentmodule:: dependency_injector.providers
|
|
|
|
|
|
|
|
:py:class:`List` provider provides a list of values.
|
|
|
|
|
|
|
|
.. literalinclude:: ../../examples/providers/list.py
|
|
|
|
:language: python
|
2020-06-29 20:32:48 +00:00
|
|
|
:lines: 3-
|
2020-09-02 01:39:23 +00:00
|
|
|
:emphasize-lines: 19-22
|
2020-06-14 21:32:12 +00:00
|
|
|
|
2020-09-02 01:39:23 +00:00
|
|
|
``List`` provider handles positional arguments the same way as a :ref:`factory-provider`.
|
2020-06-14 21:32:12 +00:00
|
|
|
|
2020-09-02 01:39:23 +00:00
|
|
|
.. note::
|
|
|
|
Keyword argument are not supported.
|
2020-06-14 21:32:12 +00:00
|
|
|
|
|
|
|
.. disqus::
|