mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-27 12:04:00 +03:00
21 lines
645 B
ReStructuredText
21 lines
645 B
ReStructuredText
Callable provider
|
|
=================
|
|
|
|
.. meta::
|
|
:keywords: Python,DI,Dependency injection,IoC,Inversion of Control,Function,Method,Example
|
|
:description: Callable provider helps to make dependencies injection into functions. This page
|
|
demonstrates how to use a Callable provider.
|
|
|
|
.. currentmodule:: dependency_injector.providers
|
|
|
|
:py:class:`Callable` provider calls a function, a method or another callable.
|
|
|
|
.. literalinclude:: ../../examples/providers/callable.py
|
|
:language: python
|
|
:lines: 3-
|
|
|
|
``Callable`` provider handles an injection of the dependencies the same way like a
|
|
:ref:`factory-provider`.
|
|
|
|
.. disqus::
|