You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MNT]: mark **kwargs as Any to suppress warnings about "partially unknown" function signatures in pyright #27030
I have no issue with doing this, especially if it helps with pyright (I mostly use mypy which doesn't complain about this)
My slight hesitation is a readability argument, where it doesn't add any information, but just takes up more space. However, these are (largely) isolated in pyi stub files (plus generated code in pyplot.py), where any readability argument really falls quite flat.
Longer term I'd be interested in investigating PEP 692 style TypedDict annotations for more of our **kwargs, but I suspect that will prove a bit frustrating because:
The sheer number of arguments some of our methods/classes have
The fact that things seem reusable, but then you have to take out certain arguments in various usages
That it requires keeping a parallel list up to date (in addition to the source (usually __init__ kwargs) and the docstring(s) (though we template that out pretty well in most cases)), having to update the TypedDict definition adds complexity there
We do use such for some deprecation machinery already, but that is the only place we use it so far:
Hi! If no one opposes, I would like to claim this issue. I would love to contribute to matplotlib, and this issue seems simple enough to be a good starting point. Please let me know if there are any objections. Thanks!
sorry for the inactivity, it's midterm season 😅 thank you @PaMeirelles! if you'd like to open a draft PR or something of the sort, i would be happy to help with your effort.
Activity
ksunden commentedon Oct 9, 2023
I have no issue with doing this, especially if it helps with pyright (I mostly use mypy which doesn't complain about this)
My slight hesitation is a readability argument, where it doesn't add any information, but just takes up more space. However, these are (largely) isolated in pyi stub files (plus generated code in pyplot.py), where any readability argument really falls quite flat.
Longer term I'd be interested in investigating PEP 692 style TypedDict annotations for more of our
**kwargs, but I suspect that will prove a bit frustrating because:__init__kwargs) and the docstring(s) (though we template that out pretty well in most cases)), having to update theTypedDictdefinition adds complexity thereWe do use such for some deprecation machinery already, but that is the only place we use it so far:
https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/_api/deprecation.pyi#L15
@vidhanio would you like to open a PR for this?
PaMeirelles commentedon Oct 11, 2023
Hi! If no one opposes, I would like to claim this issue. I would love to contribute to matplotlib, and this issue seems simple enough to be a good starting point. Please let me know if there are any objections. Thanks!
rcomer commentedon Oct 11, 2023
@PaMeirelles anyone can work on any issue so please go ahead! Our Contributors’ Guide is here:
https://matplotlib.org/devdocs/devel/index.html
PaMeirelles commentedon Oct 13, 2023
Awesome! Thanks for the opportunity.
vidhanio commentedon Oct 13, 2023
sorry for the inactivity, it's midterm season 😅 thank you @PaMeirelles! if you'd like to open a draft PR or something of the sort, i would be happy to help with your effort.
timhoffm commentedon Dec 19, 2025
Closing as inactive. Feel free to reopen if there’s still need.
Type `kwargs` as `Any` in `plt.show`
Type `kwargs` as `Any` in `plt.show` (#32460)