diff --git a/mypy/suggestions.py b/mypy/suggestions.py index 348ee0dcf330e..8276af0087d49 100644 --- a/mypy/suggestions.py +++ b/mypy/suggestions.py @@ -439,7 +439,7 @@ def get_suggestion(self, mod: str, node: FuncDef) -> PyAnnotateSignature: else: ret_types = [NoneType()] - guesses = [refine_callable(best, best.copy_modified(ret_type=t)) for t in ret_types] + guesses = [best.copy_modified(ret_type=refine_type(best.ret_type, t)) for t in ret_types] guesses = self.filter_options(guesses, is_method) best, errors = self.find_best(node, guesses) @@ -921,8 +921,6 @@ def refine_union(t: UnionType, s: ProperType) -> Type: if not refined: new_items.append(lhs) - print('done', new_items) - # We don't ever want to drop None while making these things and # make_simplified_union calls join which cases with strict_optional_set(True):