Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
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
Function | Parameter | Literal replacing str | PR |
---|---|---|---|
mpl.set_loglevel | level | "notset", "debug", "info", "warning", "error", "critical" | #30302 |
plt.connect | s | "button_press_event", "button_release_event" , ... | #30275 |
plt.Axes.scatter | marker | See MarkerType behind | #30261 |
mpl.rc | group | "animation", "axes", axes3d, "axes3d", "boxplot" , ... | #30316 |
mpl.RcParams.get_item /set_item | key | -- | #30316 |
Type | Literal replacing str | PR |
---|---|---|
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]