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 743a005

Browse filesBrowse files
authored
Merge pull request #29529 from timhoffm/mnt-matplotlibrc-none
MNT: Deprecate other capitalization than "None" in matplotlibrc
2 parents 6c5e3f3 + 5c8c9b5 commit 743a005
Copy full SHA for 743a005

File tree

Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed
Open diff view settings
Collapse file
+7Lines changed: 7 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
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.
Collapse file

‎lib/matplotlib/rcsetup.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ def _make_type_validator(cls, *, allow_none=False):
191191
def validator(s):
192192
if (allow_none and
193193
(s is None or cbook._str_lower_equal(s, "none"))):
194+
if cbook._str_lower_equal(s, "none") and s != "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 lead to an "
199+
"error from version 3.13 onward. Please use 'None' "
200+
"instead."
201+
)
194202
return None
195203
if cls is str and not isinstance(s, str):
196204
raise ValueError(f'Could not convert {s!r} to str')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.