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

Function get_args

mypyc/irbuild/function.py:669–681  ·  view source on GitHub ↗
(builder: IRBuilder, rt_args: Sequence[RuntimeArg], line: int)

Source from the content-addressed store, hash-verified

667
668
669def get_args(builder: IRBuilder, rt_args: Sequence[RuntimeArg], line: int) -> ArgInfo:
670 # The environment operates on Vars, so we make some up
671 fake_vars = [(Var(arg.name), arg.type) for arg in rt_args]
672 args = [
673 builder.read(builder.add_local_reg(var, type, is_arg=True), line)
674 for var, type in fake_vars
675 ]
676 arg_names = [
677 arg.name if arg.kind.is_named() or (arg.kind.is_optional() and not arg.pos_only) else None
678 for arg in rt_args
679 ]
680 arg_kinds = [arg.kind for arg in rt_args]
681 return ArgInfo(args, arg_names, arg_kinds)
682
683
684def gen_glue_method(

Calls 6

VarClass · 0.90
ArgInfoClass · 0.85
add_local_regMethod · 0.80
is_namedMethod · 0.80
readMethod · 0.45
is_optionalMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…