Skip to content

Commit 0323744

Browse files
committed
fix mypy
1 parent 6c51e55 commit 0323744

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

oqpy/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def to_ast(self, program: Program) -> ast.Expression:
439439
def to_ast(program: Program, item: AstConvertible) -> ast.Expression:
440440
"""Convert an object to an AST node."""
441441
if hasattr(item, "_to_oqpy_expression"):
442-
return item._to_oqpy_expression().to_ast(program)
442+
return item._to_oqpy_expression().to_ast(program) # type: ignore[union-attr]
443443
if isinstance(item, (complex, np.complexfloating)):
444444
if item.imag == 0:
445445
return to_ast(program, item.real)
@@ -479,7 +479,7 @@ def to_ast(program: Program, item: AstConvertible) -> ast.Expression:
479479
if isinstance(item, ast.Expression):
480480
return item
481481
if hasattr(item, "to_ast"): # Using isinstance(HasToAst) slowish
482-
return item.to_ast(program)
482+
return item.to_ast(program) # type: ignore[union-attr]
483483
raise TypeError(f"Cannot convert {item} of type {type(item)} to ast")
484484

485485

0 commit comments

Comments
 (0)