Revert "Add overriding logic for Container provider"

This reverts commit b727be3f9a.
This commit is contained in:
Roman Mogylatov 2020-06-24 13:24:57 -04:00
parent b727be3f9a
commit feab6b6814
2 changed files with 381 additions and 664 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2160,7 +2160,7 @@ cdef class Container(Provider):
deepcopy(self.container, memo),
**deepcopy(self.overriding_providers, memo),
)
self._copy_overridings(copied, memo)
# self._copy_overridings(copied, memo)
return copied
@ -2175,18 +2175,7 @@ cdef class Container(Provider):
def override(self, provider):
"""Override provider with another provider."""
self.container.override(provider)
return super(Container, self).override(provider)
def reset_last_overriding(self):
"""Reset last overriding provider."""
self.container.reset_last_overriding()
return super(Container, self).reset_last_overriding()
def reset_override(self):
"""Reset all overriding providers."""
self.container.reset_override()
return super(Container, self).reset_override()
raise Error('Provider {0} can not be overridden'.format(self))
cpdef object _provide(self, tuple args, dict kwargs):
"""Return single instance."""