Skip to content

Commit

Permalink
Add type ignores for partial and functools.wraps
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-git committed Jun 20, 2024
1 parent e49117a commit 54cde3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/magic_di/_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _get(self, obj: type[T]) -> type[T] | None:

def _wrap(obj: type[T], *args: Any, **kwargs: Any) -> type[T]:
if not inspect.isclass(obj):
partial = functools.wraps(obj)(functools.partial(obj, *args, **kwargs))
partial = functools.wraps(obj)(functools.partial(obj, *args, **kwargs)) # type: ignore[var-annotated]
return cast(type[T], partial)

_instance: T | None = None
Expand Down Expand Up @@ -99,7 +99,7 @@ def new(_: Any) -> T:
#
# Here we manually create a new singleton class factory using the `type` metaclass
# Since the original class was not modified, it will use its own metaclass.
return functools.wraps(
return functools.wraps( # type: ignore[return-value]
obj,
updated=(),
)(
Expand Down

0 comments on commit 54cde3a

Please sign in to comment.