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

Commit93e01c8

Browse files
rcomertimhoffm
authored andcommitted
MNT: Deprecate other capitalization than "None" in matplotlibrc
The `*_or_None` validators have accepted any capitalization of thestring "none" as input. This is overly permissive andwill likely lead to conflicts in the future because we cannotdistinguish between resolving to `None` and `"none"` which may be needfor some parameters in the future.Inspired by#29481.
1 parent9e3ada3 commit93e01c8

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Capitalization of None in matplotlibrc
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
In:file:`matplotlibrc` config files every capitalization of None was
5+
accepted for denoting the Python constant `None`. This is deprecated. The
6+
only accepted capitalization is now None, i.e. starting with a capital letter
7+
and all other letters in lowercase.

‎lib/matplotlib/rcsetup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ def _make_type_validator(cls, *, allow_none=False):
191191
defvalidator(s):
192192
if (allow_noneand
193193
(sisNoneorcbook._str_lower_equal(s,"none"))):
194+
ifcbook._str_lower_equal(s,"none")ands!="None":
195+
_api.warn_deprecated(
196+
"3.11",
197+
message=f"Using the capitalization{s!r} in matplotlibrc for "
198+
"*None* is deprecated in %(removal)s and will leaa to "
199+
"an error two versions later. Please use 'None' instead."
200+
)
194201
returnNone
195202
ifclsisstrandnotisinstance(s,str):
196203
raiseValueError(f'Could not convert{s!r} to str')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp