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 f3a2cff

Browse filesBrowse 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 afa8d28 commit f3a2cff
Copy full SHA for f3a2cff

File tree

Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-1
lines changed

‎doc/api/next_api_changes/deprecations.rst

Copy file name to clipboardExpand all lines: doc/api/next_api_changes/deprecations.rst
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,10 @@ Setting the *orientation* of an ``eventplot()`` or `.EventCollection` to "none"
422422
or None is deprecated; set it to "horizontal" instead. Moreover, the two
423423
orientations ("horizontal" and "vertical") will become case-sensitive in the
424424
future.
425+
426+
Case-insensitive properties
427+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
428+
Normalization of upper or mixed-case property names to lowercase in
429+
`.Artist.set` and `.Artist.update` is deprecated. In the future, property
430+
names will be passed as is, allowing one to pass names such as *patchA* or
431+
*UVC*.

‎lib/matplotlib/artist.py

Copy file name to clipboardExpand all lines: lib/matplotlib/artist.py
+6-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.