diff --git a/codeflash/context/code_context_extractor.py b/codeflash/context/code_context_extractor.py index 89d98ab53..a77cc29e6 100644 --- a/codeflash/context/code_context_extractor.py +++ b/codeflash/context/code_context_extractor.py @@ -871,8 +871,7 @@ def resolve_transitive_type_deps(cls: type) -> list[type]: import typing try: - init_attr = "__init__" - init_method = getattr(cls, init_attr) + init_method = getattr(cls, "__init__") hints = typing.get_type_hints(init_method) except Exception: return [] diff --git a/pyproject.toml b/pyproject.toml index 771d3ca3e..6af1d1435 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -289,6 +289,7 @@ ignore = [ "SIM108", # Ternary operator suggestion "F841", # Unused variable (often intentional) "ANN202", # Missing return type for private functions + "B009", # getattr-with-constant - needed to avoid mypy [misc] on dunder access ] [tool.ruff.lint.flake8-type-checking]