MCPcopy Index your code
hub / github.com/python/mypy / check_isinstance_arg

Method check_isinstance_arg

mypyc/annotate.py:393–401  ·  view source on GitHub ↗
(self, arg: Expression)

Source from the content-addressed store, hash-verified

391 )
392
393 def check_isinstance_arg(self, arg: Expression) -> None:
394 if isinstance(arg, RefExpr):
395 if isinstance(arg.node, TypeInfo) and arg.node.is_protocol:
396 self.annotate(
397 arg, f'Expensive isinstance() check against protocol "{arg.node.name}".'
398 )
399 elif isinstance(arg, TupleExpr):
400 for item in arg.items:
401 self.check_isinstance_arg(item)
402
403 def visit_lambda_expr(self, o: LambdaExpr, /) -> None:
404 self.annotate(

Callers 1

visit_call_exprMethod · 0.95

Calls 2

annotateMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected