-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Error for invalid varargs and varkwargs to Any call #20324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
|
Surprised there were this many primer hits, but they seem right. I think error messages can be improved here, will land that after I land this |
This comment has been minimized.
This comment has been minimized.
|
Diff from mypy_primer, showing the effect of this PR on open source code: pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/excel/_xlsxwriter.py:260: error: Expected iterable as variadic argument [misc]
pandera (https://github.com/pandera-dev/pandera)
+ tests/pandas/test_extensions.py:57: error: Argument after ** must be a mapping, not "object" [arg-type]
+ tests/pandas/test_extensions.py:99: error: Argument after ** must be a mapping, not "object" [arg-type]
apprise (https://github.com/caronc/apprise)
+ apprise/config/base.py:807: error: Argument after ** must be a mapping, not "str" [arg-type]
xarray (https://github.com/pydata/xarray)
+ xarray/core/common.py: note: In member "squeeze" of class "DataWithCoords":
+ xarray/core/common.py:460: error: Keywords must be strings [misc]
+ xarray/core/dataset.py: note: In member "_stack_once" of class "Dataset":
+ xarray/core/dataset.py:5204: error: Keywords must be strings [misc]
openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/core/imports.py: note: In member "add_items" of class "Batch":
+ openlibrary/core/imports.py:131: error: Argument after ** must be a mapping, not "str | dict[Any, Any]" [arg-type]
|
| self, args: list[Expression], arg_kinds: list[ArgKind], callee: Type, context: Context | ||
| ) -> tuple[Type, Type]: | ||
| arg_types = self.infer_arg_types_in_empty_context(args) | ||
| for arg_type, arg_kind in zip(arg_types, arg_kinds): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe extract this into a helper? This loop is identical to one around L2516. Probably not a big deal, but would be saner
Fixes #18783
See also #18207