There was an error while loading. Please reload this page.
2 parents 6c5e3f3 + 5c8c9b5 commit 743a005Copy full SHA for 743a005
2 files changed
doc/api/next_api_changes/deprecations/ 29529-TH.rst
@@ -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
@@ -191,6 +191,14 @@ def _make_type_validator(cls, *, allow_none=False):
191
def validator(s):
192
if (allow_none and
193
(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
+ )
202
return None
203
if cls is str and not isinstance(s, str):
204
raise ValueError(f'Could not convert {s!r} to str')
0 commit comments