Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[MNT] [TYPING]: Use of Literal #30257

Open
@ZPyrolink

Description

@ZPyrolink

Summary

While checkingpyplot and correspondingmatplotlib methods, I noticed that there are several functions where we could usetyping.Literal to explicitly indicate the possible values and have them suggested by IDEs.
We also can create the corresponding TypeAlias onmatplotlib.typing when necessary.

Proposed fix

FunctionParameterLiteral replacing strPR
mpl.set_loglevellevel"notset", "debug", "info", "warning", "error", "critical"#30302
plt.connects"button_press_event", "button_release_event", ...#30275
plt.Axes.scattermarkerSee MarkerType behind#30261
mpl.rcgroup"animation", "axes", axes3d, "axes3d", "boxplot", ...#30316
mpl.RcParams.get_item /set_itemkey--#30316
TypeLiteral replacing strPR
MarkerType".", ",", "o"#30261

On MarkerType we can also add litterals for the tuple version that is not indicated for now:

tuple[int,Literal[1,2,3],int]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp