8000 Fix linting for and _validate_linestyle_or_None to mypy allowlist · matplotlib/matplotlib@a4e6f44 · GitHub
[go: up one dir, main page]

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

Appearance settings

Commit a4e6f44

Browse files
committed
Fix linting for and _validate_linestyle_or_None to mypy allowlist
1 parent 39eef79 commit a4e6f44

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ci/mypy-stubtest-allowlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ matplotlib\.pylab(\..*)?
55
matplotlib\._.*
66
matplotlib\.rcsetup\._listify_validator
77
matplotlib\.rcsetup\._validate_linestyle
8+
matplotlib\.rcsetup\._validate_linestyle_or_None
89
matplotlib\.ft2font\.Glyph
910
matplotlib\.testing\.jpl_units\..*
1011
matplotlib\.sphinxext(\..*)?

lib/matplotlib/axis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,11 @@ def __init__(
155155
# otherwise `grid(color=(1, 1, 1, 0.5))` would work like
156156
# grid(color=(1, 1, 1, 0.5), alpha=rcParams['grid.alpha'])
157157
# so the that the rcParams default would override color alpha.
158+
158159
grid_alpha = (
159-
mpl._val_or_rc(
160-
mpl.rcParams[f"grid.{xaxis_yaxis}.{major_minor}.alpha"], # grid_alpha is None
160+
# grid_alpha is None so we can use the first key
161+
mpl._val_or_rc(
162+
mpl.rcParams[f"grid.{xaxis_yaxis}.{major_minor}.alpha"],
161163
f"grid.{major_minor}.alpha",
162164
"grid.alpha",
163165
)

0 commit comments

Comments
 (0)
0