Object providersΒΆ

Object provider returns provided instance “as is”.

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
"""Object providers example."""

import dependency_injector.providers as providers


# Creating object provider:
object_provider = providers.Object(1)

# Making some asserts:
assert object_provider() == 1