Skip to content

Commit

Permalink
chore: fix newer mypy problems
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Jan 10, 2024
1 parent 9b31ff6 commit 8b46d82
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions guppy/cfg/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion guppy/checker/expr_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +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]
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
Expand Down
2 changes: 1 addition & 1 deletion guppy/hugr/hugr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion guppy/hugr/visualise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8b46d82

Please sign in to comment.