mypy
mypy copied to clipboard
Fixes issue #17840 (shows signature of __call__ for incompatible function argument)
Fixes issue #17840 (shows signature of call for incompatible function argument) made modifications to messages.py
- created a note_call_message function to just return the note message for call type instead of emitting the note
- implemented changes to fix issue #17840
wrote one unit test in check-callable:testCallableSubtypingTrivialSuffix
Diff from mypy_primer, showing the effect of this PR on open source code:
werkzeug (https://github.com/pallets/werkzeug)
+ tests/test_formparser.py:436: note: "TStreamFactory.__call__" has type "Callable[[], Any]"
also added added notes to some tests in check-inference.test and check-protocols.test
Diff from mypy_primer, showing the effect of this PR on open source code:
werkzeug (https://github.com/pallets/werkzeug)
+ tests/test_formparser.py:436: note: "TStreamFactory.__call__" has type "Callable[[], Any]"
Thank you for the feedback, i've implemented the changes
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/application.py:1093:38: note: "RoleFunction.__call__" has type "Callable[[str, str, str, int, Inliner, DefaultArg(dict[str, Any] | None, 'options'), DefaultArg(Sequence[str], 'content')], tuple[list[Node], list[system_message]]]"
werkzeug (https://github.com/pallets/werkzeug)
+ tests/test_formparser.py:436: note: "TStreamFactory.__call__" has type "Callable[[Arg(int | None, 'total_content_length'), Arg(str | None, 'content_type'), Arg(str | None, 'filename'), DefaultArg(int | None, 'content_length')], IO[bytes]]"