Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Aug 16, 2021
1 parent 9b758e5 commit eb600e3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lagom/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,12 @@ def _infer_dependencies(
return {key: dep for (key, dep) in sub_deps.items() if dep is not None}

def _get_spec_without_self(self, func: Callable[..., X]) -> FunctionSpec:
if isinstance(func, FunctionType) or isinstance(func, MethodType):
spec = self._reflector.get_function_spec(func)
else:
t = cast(Type[X], func)
spec = self._reflector.get_function_spec(t.__init__).without_argument(
if isinstance(func, (FunctionType, MethodType)):
return self._reflector.get_function_spec(func)
t = cast(Type[X], func)
return self._reflector.get_function_spec(t.__init__).without_argument(
"self"
)
return spec


class ExplicitContainer(Container):
Expand Down

0 comments on commit eb600e3

Please sign in to comment.