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

Commitdd98207

Browse files
committed
Add (color, alpha) tuple as a valid ColorType
Introduced by#24691, merged shortly before#24976Not totally sold on the name 'RawColorType', but couldn't think of something I like betterNoticed that one of the other type aliases was not documented, so fixed that while I was editing these two files
1 parenta844eca commitdd98207

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

‎.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ repos:
1717
hooks:
1818
-id:check-added-large-files
1919
-id:check-docstring-first
20+
exclude:lib/matplotlib/typing.py# docstring used for attribute flagged by check
2021
-id:end-of-file-fixer
2122
exclude_types:[svg]
2223
-id:mixed-line-ending

‎doc/api/typing_api.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
``matplotlib.typing``
33
*********************
44

5+
..autodata::matplotlib.typing.RawColorType
6+
..autodata::matplotlib.typing.RawColourType
57
..autodata::matplotlib.typing.ColorType
68
..autodata::matplotlib.typing.ColourType
79
..autodata::matplotlib.typing.LineStyleType
810
..autodata::matplotlib.typing.DrawStyleType
911
..autodata::matplotlib.typing.MarkEveryType
1012
..autodata::matplotlib.typing.FillStyleType
1113
..autodata::matplotlib.typing.RcStyleType
14+
..autodata::matplotlib.typing.HashableList
15+
:annotation: Nested list with Hashable values

‎lib/matplotlib/typing.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
# The following are type aliases. Once python 3.9 is dropped, they should be annotated
2020
# using ``typing.TypeAlias`` and Unions should be converted to using ``|`` syntax.
2121

22-
ColorType=Union[tuple[float,float,float],tuple[float,float,float,float],str]
22+
RawColorType=Union[tuple[float,float,float],tuple[float,float,float,float],str]
23+
RawColourType=RawColorType
24+
25+
ColorType=Union[RawColorType,tuple[RawColorType,float]]
2326
ColourType=ColorType
2427

2528
LineStyleType=Union[str,tuple[float,Sequence[float]]]
@@ -43,3 +46,4 @@
4346
]
4447

4548
HashableList=list[Union[Hashable,"HashableList"]]
49+
"""A nested list of Hashable values."""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp