diff --git a/VERSION b/VERSION index 267577d4..2b7c5ae0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.1 +0.4.2 diff --git a/objects/providers.py b/objects/providers.py index 1672e403..4e7b2a57 100644 --- a/objects/providers.py +++ b/objects/providers.py @@ -41,7 +41,28 @@ class Provider(object): """ Returns provider delegate. """ - return self.__call__ + return ProviderDelegate(self) + + +class ProviderDelegate(Provider): + """ + Provider's delegate. + """ + + def __init__(self, delegated): + """ + Initializer. + + :type delegated: Provider + """ + self.delegated = delegated + super(ProviderDelegate, self).__init__() + + def __call__(self): + """ + Returns provided instance. + """ + return self.delegated.__call__ def prepare_injections(injections):