diff --git a/guppy/cfg/builder.py b/guppy/cfg/builder.py index 878437bf..b83b0483 100644 --- a/guppy/cfg/builder.py +++ b/guppy/cfg/builder.py @@ -185,7 +185,7 @@ def visit_FunctionDef( bb.statements.append(new_node) return bb - def generic_visit(self, node: ast.AST, bb: BB, jumps: Jumps) -> BB | None: # type: ignore[override] + def generic_visit(self, node: ast.AST, bb: BB, jumps: Jumps) -> BB | None: # When adding support for new statements, we have to remember to use the # ExprBuilder to transform all included expressions! raise GuppyError("Statement is not supported", node) @@ -365,7 +365,7 @@ def visit_IfExp(self, node: ast.IfExp, bb: BB, true_bb: BB, false_bb: BB) -> Non self.visit(node.body, then_bb, true_bb, false_bb) self.visit(node.orelse, else_bb, true_bb, false_bb) - def generic_visit(self, node: ast.expr, bb: BB, true_bb: BB, false_bb: BB) -> None: # type: ignore[override] + def generic_visit(self, node: ast.expr, bb: BB, true_bb: BB, false_bb: BB) -> None: # We can always fall back to building the node as a regular expression and using # the result as a branch predicate pred, bb = ExprBuilder.build(node, self.cfg, bb) diff --git a/guppy/checker/expr_checker.py b/guppy/checker/expr_checker.py index 9e799399..5ad23c8a 100644 --- a/guppy/checker/expr_checker.py +++ b/guppy/checker/expr_checker.py @@ -169,9 +169,7 @@ def visit_Call(self, node: ast.Call, ty: GuppyType) -> tuple[ast.expr, Subst]: else: raise GuppyTypeError(f"Expected function type, got `{func_ty}`", node.func) - def generic_visit( # type: ignore[override] - self, node: ast.expr, ty: GuppyType - ) -> tuple[ast.expr, Subst]: + def generic_visit(self, node: ast.expr, ty: GuppyType) -> tuple[ast.expr, Subst]: # Try to synthesize and then check if we can unify it with the given type node, synth = self._synthesize(node, allow_free_vars=False) subst, inst = check_type_against(synth, ty, node, self._kind) diff --git a/guppy/hugr/hugr.py b/guppy/hugr/hugr.py index 980a1c63..fb671bb5 100644 --- a/guppy/hugr/hugr.py +++ b/guppy/hugr/hugr.py @@ -5,7 +5,7 @@ from dataclasses import dataclass, field from typing import Any, Optional -import networkx as nx # type: ignore[import] +import networkx as nx # type: ignore[import-untyped] import guppy.hugr.ops as ops import guppy.hugr.raw as raw diff --git a/guppy/hugr/visualise.py b/guppy/hugr/visualise.py index 450b5293..e3c52cc0 100644 --- a/guppy/hugr/visualise.py +++ b/guppy/hugr/visualise.py @@ -3,7 +3,7 @@ from collections.abc import Iterable from typing import TYPE_CHECKING -import graphviz as gv # type: ignore[import] +import graphviz as gv # type: ignore[import-untyped] from guppy.cfg.analysis import ( DefAssignmentDomain,