Compute a list of guesses for a function's type. This focuses just on the argument types, and doesn't change the provided return type.
(
self,
is_method: bool,
base: CallableType,
defaults: list[Type | None],
callsites: list[Callsite],
uses: list[list[Type]],
)
| 403 | ] |
| 404 | |
| 405 | def get_guesses( |
| 406 | self, |
| 407 | is_method: bool, |
| 408 | base: CallableType, |
| 409 | defaults: list[Type | None], |
| 410 | callsites: list[Callsite], |
| 411 | uses: list[list[Type]], |
| 412 | ) -> list[CallableType]: |
| 413 | """Compute a list of guesses for a function's type. |
| 414 | |
| 415 | This focuses just on the argument types, and doesn't change the provided return type. |
| 416 | """ |
| 417 | options = self.get_args(is_method, base, defaults, callsites, uses) |
| 418 | |
| 419 | # Take the first `max_guesses` guesses. |
| 420 | product = itertools.islice(itertools.product(*options), 0, self.max_guesses) |
| 421 | return [refine_callable(base, base.copy_modified(arg_types=list(x))) for x in product] |
| 422 | |
| 423 | def get_callsites(self, func: FuncDef) -> tuple[list[Callsite], list[str]]: |
| 424 | """Find all call sites of a function.""" |
no test coverage detected