Skip to content

Commit 7515f4f

Browse files
committed
Deprecate case-insensitive properties.
As a real case, incorrectly passing "axA" instead of "axesA" to ConnectionPatch currently triggers a slightly confusing warning regarding the non-existence of the "axa" property.
1 parent 98560a8 commit 7515f4f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

doc/api/next_api_changes/deprecations.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,3 +415,8 @@ parent figure, though they can be later removed with ``ax.remove()``.
415415

416416
``.BboxBase.inverse_transformed`` is deprecated (call `.BboxBase.transformed`
417417
on the `~.Transform.inverted()` transform instead).
418+
419+
Case-insensitive properties
420+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
421+
Support for upper or mixed-case property names in `.Artist.set` and
422+
`.Artist.update` is deprecated. Pass properties in lowercase.

lib/matplotlib/artist.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,12 @@ def update(self, props):
980980
ret = []
981981
with cbook._setattr_cm(self, eventson=False):
982982
for k, v in props.items():
983-
k = k.lower()
983+
if k != k.lower():
984+
cbook.warn_deprecated(
985+
"3.3", message="Case-insensitive properties were "
986+
"deprecated in %(since)s and support will be removed "
987+
"%(removal)s")
988+
k = k.lower()
984989
# White list attributes we want to be able to update through
985990
# art.update, art.set, setp.
986991
if k == "axes":

0 commit comments

Comments
 (0)