python-dependency-injector/tests/unit/samples/wiringstringidssamples/container.py

18 lines
356 B
Python
Raw Normal View History

from dependency_injector import containers, providers
from .service import Service
class SubContainer(containers.DeclarativeContainer):
int_object = providers.Object(1)
class Container(containers.DeclarativeContainer):
config = providers.Configuration()
service = providers.Factory(Service)
sub = providers.Container(SubContainer)