python-dependency-injector/docs/providers/callable.rst

21 lines
645 B
ReStructuredText
Raw Normal View History

Callable provider
2020-09-02 21:33:02 +00:00
=================
2015-07-15 21:48:30 +00:00
.. 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.
2015-07-15 21:48:30 +00:00
.. currentmodule:: dependency_injector.providers
2015-07-15 21:48:30 +00:00
:py:class:`Callable` provider calls a function, a method or another callable.
2015-07-15 21:48:30 +00:00
.. 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::