X Tutup
Skip to content

Add type hint for fig_kw in subplots#31033

Merged
QuLogic merged 1 commit intomatplotlib:mainfrom
sanrishi:fix/31003-fig-kw-typing
Jan 27, 2026
Merged

Add type hint for fig_kw in subplots#31033
QuLogic merged 1 commit intomatplotlib:mainfrom
sanrishi:fix/31003-fig-kw-typing

Conversation

@sanrishi
Copy link

@sanrishi sanrishi commented Jan 25, 2026

PR summary

Connects to #31003

Description

Adds Any type hint to **fig_kw in pyplot.subplots.

Rationale

Currently, fig_kw is untyped. This causes reportUnknownMemberType errors in downstream projects (like pandas-stubs) that attempt to use strict Pyright type checking. Since fig_kw passes arbitrary keyword arguments to the Figure constructor, Any is the appropriate type annotation here.

PR checklist

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do this for all overloads.

@sanrishi sanrishi force-pushed the fix/31003-fig-kw-typing branch from 99bc9a7 to 009101a Compare January 25, 2026 16:59
@sanrishi sanrishi force-pushed the fix/31003-fig-kw-typing branch from 009101a to 3f2bc7c Compare January 25, 2026 17:10
@sanrishi sanrishi requested a review from timhoffm January 25, 2026 17:10
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a side-note, subplot_mosaic already has these annotations.

Related, and possible further cases: #27030.

@QuLogic
Copy link
Member

QuLogic commented Jan 27, 2026

What is this REL prefix in the PR title/commit message supposed to be? This has nothing to do with releases.

@QuLogic QuLogic changed the title REL: Add type hint for fig_kw in subplots (Fixes #31003) Add type hint for fig_kw in subplots Jan 27, 2026
@QuLogic QuLogic merged commit 9957c39 into matplotlib:main Jan 27, 2026
43 checks passed
@QuLogic QuLogic added this to the v3.11.0 milestone Jan 27, 2026
andreas16700 added a commit to andreas16700/matplotlib that referenced this pull request Jan 28, 2026
llohse pushed a commit to llohse/matplotlib that referenced this pull request Feb 3, 2026
llohse pushed a commit to llohse/matplotlib that referenced this pull request Feb 3, 2026
llohse pushed a commit to llohse/matplotlib that referenced this pull request Feb 3, 2026
@sanrishi sanrishi deleted the fix/31003-fig-kw-typing branch February 3, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH]: Add types for fig_kw argument in subplots

3 participants

X Tutup