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

Class FunctionContext

mypy/plugin.py:448–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446# A no-op callback would just return the inferred return type, but a useful
447# callback at least sometimes can infer a more precise type.
448class FunctionContext(NamedTuple):
449 arg_types: list[list[Type]] # List of actual caller types for each formal argument
450 arg_kinds: list[list[ArgKind]] # Ditto for argument kinds, see nodes.ARG_* constants
451 # Names of formal parameters from the callee definition,
452 # these will be sufficient in most cases.
453 callee_arg_names: list[str | None]
454 # Names of actual arguments in the call expression. For example,
455 # in a situation like this:
456 # def func(**kwargs) -> None:
457 # pass
458 # func(kw1=1, kw2=2)
459 # callee_arg_names will be ['kwargs'] and arg_names will be [['kw1', 'kw2']].
460 arg_names: list[list[str | None]]
461 default_return_type: Type # Return type inferred from signature
462 args: list[list[Expression]] # Actual expressions for each formal argument
463 context: Context # Relevant location context (e.g. for error messages)
464 api: CheckerPluginInterface
465
466
467# A context for a method signature hook that infers a better signature for a

Callers 1

apply_function_pluginMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…