Skip to content

Commit

Permalink
Stop singleton provider from recreating objects implementing __len__ (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Klavionik authored Oct 28, 2023
1 parent a037c55 commit 99b889c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rodi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def __init__(self, _type, _args_callbacks):
self._instance = None

def __call__(self, context, parent_type):
if not self._instance:
if self._instance is None:
self._instance = (
self._type(*[fn(context, self._type) for fn in self._args_callbacks])
if self._args_callbacks
Expand Down

0 comments on commit 99b889c

Please sign in to comment.