Add function definition notes for too_many_positional_arguments errors#21410
Open
KevinRK29 wants to merge 1 commit intopython:masterfrom
Open
Add function definition notes for too_many_positional_arguments errors#21410KevinRK29 wants to merge 1 commit intopython:masterfrom
too_many_positional_arguments errors#21410KevinRK29 wants to merge 1 commit intopython:masterfrom
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: urllib3 (https://github.com/urllib3/urllib3)
+ test/with_dummyserver/test_poolmanager.py:659: note: "request" defined in "urllib3"
+ test/with_dummyserver/test_poolmanager.py:659: note: Error code "call-arg" not covered by "type: ignore[misc]" comment
core (https://github.com/home-assistant/core)
+ homeassistant/components/http/__init__.py:493: note: "HTTPRedirection" defined in "aiohttp.web_exceptions"
+ homeassistant/components/http/__init__.py:493: note: Error code "call-arg" not covered by "type: ignore[arg-type, misc]" comment
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ tests/test_string_accessors.py:226: note: "wrap" defined in "pandas.core.strings.accessor"
+ tests/test_string_accessors.py:226: note: Error code "call-arg" not covered by "type: ignore[misc]" comment
+ tests/test_string_accessors.py:284: note: "wrap" defined in "pandas.core.strings.accessor"
+ tests/test_string_accessors.py:284: note: Error code "call-arg" not covered by "type: ignore[misc]" comment
cryptography (https://github.com/pyca/cryptography)
+ tests/hazmat/primitives/test_kbkdf.py:358: note: "KBKDFHMAC" defined in "cryptography.hazmat.bindings._rust.openssl.kdf"
+ tests/hazmat/primitives/test_kbkdf.py:808: note: "KBKDFCMAC" defined in "cryptography.hazmat.bindings._rust.openssl.kdf"
xarray (https://github.com/pydata/xarray)
+ xarray/tests/test_groupby.py: note: In function "test_multiple_groupers_string":
+ xarray/tests/test_groupby.py:2980: note: "groupby" defined in "xarray.core.dataarray"
+ xarray/tests/test_groupby.py:2980: note: Error code "call-arg" not covered by "type: ignore[arg-type, misc]" comment
+ xarray/tests/test_groupby.py: note: At top level:
|
KevinRK29
commented
May 5, 2026
| @@ -972,6 +972,7 @@ def too_many_positional_arguments(self, callee: CallableType, context: Context) | |||
| msg = "Too many positional arguments" + for_function(callee) | |||
| self.fail(msg, context) | |||
Collaborator
Author
There was a problem hiding this comment.
Looking at the primer, I think I may need to change it to self.fail(msg, context, code=codes.CALL_ARG) similar to the error cases above?
Member
There was a problem hiding this comment.
Usually we try to avoid changing the error code. But in this case this looks like an oversight. I leave this up to @JukkaL to decide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followup to #20794
Adds the "foo" is defined in "bar" note for the
too_many_positional_argumentserror case