mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-05-24 23:39:11 +03:00
Override deepcopy of Container provider
This commit is contained in:
parent
1d75085c87
commit
6791f99246
File diff suppressed because it is too large
Load Diff
|
@ -612,6 +612,22 @@ class Container(DependenciesContainer):
|
||||||
self.container = container
|
self.container = container
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
|
def __deepcopy__(self, memo):
|
||||||
|
"""Create and return full copy of provider."""
|
||||||
|
cdef DependenciesContainer copied
|
||||||
|
|
||||||
|
copied = memo.get(id(self))
|
||||||
|
if copied is not None:
|
||||||
|
return copied
|
||||||
|
|
||||||
|
copied = self.__class__(self.container)
|
||||||
|
copied.__provides = deepcopy(self.__provides, memo)
|
||||||
|
copied.__providers = deepcopy(self.__providers, memo)
|
||||||
|
|
||||||
|
self._copy_overridings(copied, memo)
|
||||||
|
|
||||||
|
return copied
|
||||||
|
|
||||||
|
|
||||||
cdef class OverridingContext(object):
|
cdef class OverridingContext(object):
|
||||||
"""Provider overriding context.
|
"""Provider overriding context.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user