Skip to content

Commit 99b889c

Browse files
authored
Stop singleton provider from recreating objects implementing __len__ (#41)
1 parent a037c55 commit 99b889c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rodi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def __init__(self, _type, _args_callbacks):
396396
self._instance = None
397397

398398
def __call__(self, context, parent_type):
399-
if not self._instance:
399+
if self._instance is None:
400400
self._instance = (
401401
self._type(*[fn(context, self._type) for fn in self._args_callbacks])
402402
if self._args_callbacks

0 commit comments

Comments
 (0)