| 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. |
| 448 | class 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…