Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Labels
Milestone
Description
Bug summary
Implementation:
matplotlib/lib/matplotlib/axes/_base.py
Lines 2226 to 2228 inb766c96
defget_legend(self): | |
"""Return the `.Legend` instance, or None if no legend is defined.""" | |
returnself.legend_ |
Type hints:
matplotlib/lib/matplotlib/axes/_base.pyi
Line 228 inb766c96
defget_legend(self)->Legend: ... |
Proposed change:
- def get_legend(self) -> Legend: ...+ def get_legend(self) -> Legend | None: ...
Code for reproduction
n/a
Actual outcome
type checkers warn of unnecessaryis None
checks.
Expected outcome
type checkers should not warn of unnecessaryis None
checks.
Additional information
No response
Operating system
No response
Matplotlib Version
3.10.3
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
None