From dbde2b157e8f1d33099d95c68909e0a400ab2ff8 Mon Sep 17 00:00:00 2001 From: Roman Mogilatov Date: Wed, 11 Mar 2015 15:27:38 +0200 Subject: [PATCH] refusing of filter builtin function --- objects/providers.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/objects/providers.py b/objects/providers.py index 31a1e1e6..1cb2a00d 100644 --- a/objects/providers.py +++ b/objects/providers.py @@ -63,9 +63,15 @@ class NewInstance(Provider): def __init__(self, provides, *injections): """Initializer.""" self.provides = provides - self.init_args = tuple(filter(is_init_arg_injection, injections)) - self.attributes = tuple(filter(is_attribute_injection, injections)) - self.methods = tuple(filter(is_method_injection, injections)) + self.init_args = tuple((injection + for injection in injections + if is_init_arg_injection(injection))) + self.attributes = tuple((injection + for injection in injections + if is_attribute_injection(injection))) + self.methods = tuple((injection + for injection in injections + if is_method_injection(injection))) super(NewInstance, self).__init__() def __call__(self, *args, **kwargs): @@ -247,7 +253,9 @@ class Callable(Provider): def __init__(self, calls, *injections): """Initializer.""" self.calls = calls - self.injections = tuple(filter(is_injection, injections)) + self.injections = tuple((injection + for injection in injections + if is_injection(injection))) super(Callable, self).__init__() def __call__(self, *args, **kwargs):