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

Method filter_options

mypy/suggestions.py:437–448  ·  view source on GitHub ↗

Apply any configured filters to the possible guesses. Currently the only option is filtering based on Any prevalance.

(
        self, guesses: list[CallableType], is_method: bool, ignore_return: bool
    )

Source from the content-addressed store, hash-verified

435 return collector_plugin.mystery_hits, errors
436
437 def filter_options(
438 self, guesses: list[CallableType], is_method: bool, ignore_return: bool
439 ) -> list[CallableType]:
440 """Apply any configured filters to the possible guesses.
441
442 Currently the only option is filtering based on Any prevalance."""
443 return [
444 t
445 for t in guesses
446 if self.flex_any is None
447 or any_score_callable(t, is_method, ignore_return) >= self.flex_any
448 ]
449
450 def find_best(self, func: FuncDef, guesses: list[CallableType]) -> tuple[CallableType, int]:
451 """From a list of possible function types, find the best one.

Callers 1

get_suggestionMethod · 0.95

Calls 1

any_score_callableFunction · 0.85

Tested by

no test coverage detected