Skip to content

Commit

Permalink
type: ignore[misc]
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Nov 12, 2024
1 parent a35f1fe commit 8b8bb2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lightning/fabric/utilities/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ def _replace_dunder_methods(base_cls: type, store_explicit_arg: Optional[str] =
for cls in classes:
# Check that __init__ belongs to the class
# https://stackoverflow.com/a/5253424
if "__init__" in cls.__dict__:
cls.__old__init__ = cls.__init__
if "__init__" in cls.__dict__: # type: ignore[misc]
cls.__old__init__ = cls.__init__ # type: ignore[misc]
cls.__init__ = _wrap_init_method(cls.__init__, store_explicit_arg)

# we want at least one setattr/delattr in the chain to be patched and it can happen, that none of the subclasses
Expand Down
2 changes: 1 addition & 1 deletion src/lightning/pytorch/utilities/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def parse_class_init_keys(cls: type) -> tuple[str, Optional[str], Optional[str]]
('self', 'my_args', 'my_kwargs')
"""
init_parameters = inspect.signature(cls.__init__).parameters
init_parameters = inspect.signature(cls.__init__).parameters # type: ignore[misc]
# docs claims the params are always ordered
# https://docs.python.org/3/library/inspect.html#inspect.Signature.parameters
init_params = list(init_parameters.values())
Expand Down

0 comments on commit 8b8bb2e

Please sign in to comment.