mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Error for invalid varargs and varkwargs to Any call

Open hauntsaninja opened this issue 1 month ago • 4 comments

Fixes #18783

See also #18207

hauntsaninja avatar Nov 28 '25 23:11 hauntsaninja

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]

github-actions[bot] avatar Nov 29 '25 00:11 github-actions[bot]

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

hauntsaninja avatar Nov 29 '25 00:11 hauntsaninja

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]

github-actions[bot] avatar Nov 29 '25 00:11 github-actions[bot]

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]

github-actions[bot] avatar Nov 29 '25 01:11 github-actions[bot]

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]

github-actions[bot] avatar Dec 15 '25 00:12 github-actions[bot]