We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6d90e2 commit e4a3056Copy full SHA for e4a3056
deps.py
@@ -4,7 +4,7 @@
4
import inject
5
6
__all__ = ('attributes', 'attrs', 's', 'Interface')
7
-__version__ = '0.1'
+__version__ = '0.2'
8
9
10
class Interface:
@@ -17,7 +17,9 @@ def wrap(cls):
17
18
for property_name, property_type in hints.items():
19
if isinstance(property_type, type) and issubclass(property_type, Interface):
20
- setattr(cls, property_name, Factory(lambda: inject.instance(property_type)))
+ def _factory(klass):
21
+ return lambda: inject.instance(klass)
22
+ setattr(cls, property_name, Factory(_factory(property_type)))
23
24
kwargs['auto_attribs'] = True
25
return original_attrs(*args, **kwargs)(cls)
0 commit comments