mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 01:26:51 +03:00
refusing of filter builtin function
This commit is contained in:
parent
e61e495931
commit
dbde2b157e
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user