Skip to content

Commit cf0c262

Browse files
committed
MNT: Coerce LineStyleType strings to Literal
1 parent f8900ea commit cf0c262

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/typing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
RGBAColourType: TypeAlias = RGBAColorType
3838
ColourType: TypeAlias = ColorType
3939

40-
LineStyleType: TypeAlias = str | tuple[float, Sequence[float]]
40+
LineStyleType: TypeAlias = (
41+
Literal["-", "solid", "--", "dashed", "-.", "dashdot", ":", "dotted",
42+
"", "none", " ", "None"] |
43+
tuple[float, Sequence[float]]
44+
)
4145
DrawStyleType: TypeAlias = Literal["default", "steps", "steps-pre", "steps-mid",
4246
"steps-post"]
4347
MarkEveryType: TypeAlias = (

0 commit comments

Comments
 (0)