Skip to content

MNT: Make get_default_filetype a classmethod#31867

Merged
ksunden merged 1 commit into
matplotlib:mainfrom
timhoffm:mnt-get_default_filetype
Jun 10, 2026
Merged

MNT: Make get_default_filetype a classmethod#31867
ksunden merged 1 commit into
matplotlib:mainfrom
timhoffm:mnt-get_default_filetype

Conversation

@timhoffm

@timhoffm timhoffm commented Jun 9, 2026

Copy link
Copy Markdown
Member

FigureCanvasBase defines get_default_filetype as a class method, but all derived implementations overwrite this with an instance method. All implementations could even be static. But let's coerce to a classmethod for consistency and to not change the public API of FigureCanvasBase

@classmethod
def get_default_filetype(cls):

FigureCanvasBase defines get_default_filetype as a classmethod,
but all derived implementations overwrite this with an instance
method. All implementations could even be static. But let's
coerce to a classmethod for consistency and to not change the
public API of FigureCanvasBase
@ksunden ksunden merged commit 0677cc8 into matplotlib:main Jun 10, 2026
41 checks passed
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.

3 participants