Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update specialize.py
  • Loading branch information
BobTheBuidler authored Sep 29, 2025
commit 8a3a1b285fe1a965f87d6666853f3d2a93fcb07b
2 changes: 1 addition & 1 deletion mypyc/irbuild/specialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def translate_isinstance(builder: IRBuilder, expr: CallExpr, callee: RefExpr) ->
is_last = i == len(descs) - 1
next_block = fail_block if is_last else BasicBlock()
builder.add_bool_branch(
builder.primitive_op(desc, [obj], expr.line), pass_block, next_block
builder.primitive_op(desc, [obj], expr.line), pass_block, next_block # type: ignore [arg-type]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you avoid the # type: ignore? If there is some typing issue, I'd prefer a cast since it's more specific and tells which argument is the problematic one.

Copy link
Copy Markdown
Contributor Author

@BobTheBuidler BobTheBuidler Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. It was because descs has type list[PrimitiveDescription | None]

I'm assuming the if None in descs: return None can probably be considered as a TypeGuard of sorts by mypy but that's above my paygrade

)
if not is_last:
builder.activate_block(next_block)
Expand Down
Loading