Skip to content

MNT: expire legend-related deprecations#29832

Merged
oscargus merged 1 commit into
matplotlib:mainfrom
rcomer:legend-deprecations
Mar 31, 2025
Merged

MNT: expire legend-related deprecations#29832
oscargus merged 1 commit into
matplotlib:mainfrom
rcomer:legend-deprecations

Conversation

@rcomer

@rcomer rcomer commented Mar 29, 2025

Copy link
Copy Markdown
Member

PR summary

Expire the deprecations from #27175 and #27767

PR checklist

@rcomer rcomer added API: changes Changes to the public API, typically requiring deprecation. topic: legend labels Mar 29, 2025
@rcomer rcomer added this to the v3.11.0 milestone Mar 29, 2025
Comment thread lib/matplotlib/legend.py Outdated
"be discarded. This is deprecated since %(since)s and will "
"become an error in %(removal)s."))
raise ValueError("When passing handles and labels, they must both be "
"passed positionally or both as keywords.")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a better exception type than ValueError for this situation?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no really good match. I'm inclined to go with TypeError as that is used in other cases, when the signature is not fulfilled.

Comment thread lib/matplotlib/tests/test_legend.py
@rcomer rcomer force-pushed the legend-deprecations branch from 46ffb4c to 2bb7ea8 Compare March 30, 2025 10:38
@rcomer rcomer force-pushed the legend-deprecations branch from 2bb7ea8 to c5afbfc Compare March 30, 2025 10:59
@rcomer

rcomer commented Mar 30, 2025

Copy link
Copy Markdown
Member Author

Rebased to pick up #29834

@oscargus oscargus merged commit ade791f into matplotlib:main Mar 31, 2025
@rcomer rcomer deleted the legend-deprecations branch March 31, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API: changes Changes to the public API, typically requiring deprecation. topic: axes topic: legend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants