Skip to content

Commit e4a3056

Browse files
committed
Version 0.2
1 parent d6d90e2 commit e4a3056

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

deps.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import inject
55

66
__all__ = ('attributes', 'attrs', 's', 'Interface')
7-
__version__ = '0.1'
7+
__version__ = '0.2'
88

99

1010
class Interface:
@@ -17,7 +17,9 @@ def wrap(cls):
1717

1818
for property_name, property_type in hints.items():
1919
if isinstance(property_type, type) and issubclass(property_type, Interface):
20-
setattr(cls, property_name, Factory(lambda: inject.instance(property_type)))
20+
def _factory(klass):
21+
return lambda: inject.instance(klass)
22+
setattr(cls, property_name, Factory(_factory(property_type)))
2123

2224
kwargs['auto_attribs'] = True
2325
return original_attrs(*args, **kwargs)(cls)

0 commit comments

Comments
 (0)