You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importcollectionsfromdependency_injectorimportcontainersfromdependency_injectorimportprovidersA=collections.namedtuple('A', [])
B=collections.namedtuple('B', ['fa'])
C=collections.namedtuple('B', ['a'])
classServices(containers.DeclarativeContainer):
a=providers.Dependency()
c=providers.Factory(C, a=a)
b=providers.Factory(B, fa=a.delegate())
a=providers.Factory(A)
assertisinstance(Services(a=a).c().a, A) # ok Services(a=a).b().fa() # error: dependency_injector.errors.Error: Dependency is not defined
The text was updated successfully, but these errors were encountered:
SylvanG
changed the title
Delegate cannot be used now in container in v3.14.11
Delegate cannot be used now in the overridden container in v3.14.11
Oct 9, 2019
The text was updated successfully, but these errors were encountered: