MCPcopy Create free account
hub / github.com/python/mypy / check_union_call

Method check_union_call

mypy/checkexpr.py:3402–3416  ·  view source on GitHub ↗
(
        self,
        callee: UnionType,
        args: list[Expression],
        arg_kinds: list[ArgKind],
        arg_names: Sequence[str | None] | None,
        context: Context,
    )

Source from the content-addressed store, hash-verified

3400 return AnyType(TypeOfAny.special_form), AnyType(TypeOfAny.special_form)
3401
3402 def check_union_call(
3403 self,
3404 callee: UnionType,
3405 args: list[Expression],
3406 arg_kinds: list[ArgKind],
3407 arg_names: Sequence[str | None] | None,
3408 context: Context,
3409 ) -> tuple[Type, Type]:
3410 with self.msg.disable_type_names():
3411 results = [
3412 self.check_call(subtype, args, arg_kinds, context, arg_names)
3413 for subtype in callee.relevant_items()
3414 ]
3415
3416 return (make_simplified_union([res[0] for res in results]), callee)
3417
3418 def visit_member_expr(self, e: MemberExpr, is_lvalue: bool = False) -> Type:
3419 """Visit member expression (of form e.id)."""

Callers 1

check_callMethod · 0.95

Calls 4

check_callMethod · 0.95
make_simplified_unionFunction · 0.90
disable_type_namesMethod · 0.80
relevant_itemsMethod · 0.80

Tested by

no test coverage detected