File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ def to_ast(self, program: Program) -> ast.Expression:
439
439
def to_ast (program : Program , item : AstConvertible ) -> ast .Expression :
440
440
"""Convert an object to an AST node."""
441
441
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]
443
443
if isinstance (item , (complex , np .complexfloating )):
444
444
if item .imag == 0 :
445
445
return to_ast (program , item .real )
@@ -479,7 +479,7 @@ def to_ast(program: Program, item: AstConvertible) -> ast.Expression:
479
479
if isinstance (item , ast .Expression ):
480
480
return item
481
481
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]
483
483
raise TypeError (f"Cannot convert { item } of type { type (item )} to ast" )
484
484
485
485
You can’t perform that action at this time.
0 commit comments