mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Better diagnostic for conditional function mismatch

Open hauntsaninja opened this issue 2 years ago • 3 comments

Fixes #10575

hauntsaninja avatar Sep 04 '22 05:09 hauntsaninja

Diff from mypy_primer, showing the effect of this PR on open source code:

pyinstrument (https://github.com/joerick/pyinstrument)
+ pyinstrument/vendor/decorator.py:55: note: Original signature: def (func: builtins.object) -> Tuple[builtins.list[builtins.str], Union[builtins.str, None], Union[builtins.str, None], Union[builtins.tuple[Any, ...], None], builtins.list[builtins.str], Union[builtins.dict[builtins.str, Any], None], builtins.dict[builtins.str, Any], fallback=inspect.FullArgSpec]
+ pyinstrument/vendor/decorator.py:55: note: Redefinition signature: def (f: Any) -> Any

github-actions[bot] avatar Sep 04 '22 06:09 github-actions[bot]

Actually, this should use pretty_callable

hauntsaninja avatar Sep 04 '22 06:09 hauntsaninja

Diff from mypy_primer, showing the effect of this PR on open source code:

pyinstrument (https://github.com/joerick/pyinstrument)
+ pyinstrument/vendor/decorator.py:55: note: Original signature: def (func: builtins.object) -> Tuple[builtins.list[builtins.str], Union[builtins.str, None], Union[builtins.str, None], Union[builtins.tuple[Any, ...], None], builtins.list[builtins.str], Union[builtins.dict[builtins.str, Any], None], builtins.dict[builtins.str, Any], fallback=inspect.FullArgSpec]
+ pyinstrument/vendor/decorator.py:55: note: Redefinition signature: def (f: Any) -> Any

github-actions[bot] avatar Sep 04 '22 06:09 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

pyinstrument (https://github.com/joerick/pyinstrument)
+ pyinstrument/vendor/decorator.py:55: note: Original:
+ pyinstrument/vendor/decorator.py:55: note:     def getfullargspec(func: object) -> FullArgSpec
+ pyinstrument/vendor/decorator.py:55: note: Redefinition:
+ pyinstrument/vendor/decorator.py:55: note:     def getfullargspec(f: Any) -> Any

github-actions[bot] avatar Sep 25 '22 21:09 github-actions[bot]