mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2026-01-04 07:53:13 +03:00
20 lines
445 B
Python
20 lines
445 B
Python
from dependency_injector import containers, providers
|
|
|
|
from .service import Service, ServiceWithCallable
|
|
|
|
|
|
class SubContainer(containers.DeclarativeContainer):
|
|
|
|
int_object = providers.Object(1)
|
|
|
|
|
|
class Container(containers.DeclarativeContainer):
|
|
|
|
config = providers.Configuration()
|
|
|
|
service = providers.Factory(Service)
|
|
|
|
service_with_callable = providers.Factory(ServiceWithCallable)
|
|
|
|
sub = providers.Container(SubContainer)
|