-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Labels
Good first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!topic: typing
Milestone
Description
Bug summary
Implementation:
matplotlib/lib/matplotlib/axes/_base.py
Lines 2226 to 2228 in b766c96
def get_legend(self): | |
"""Return the `.Legend` instance, or None if no legend is defined.""" | |
return self.legend_ |
Type hints:
matplotlib/lib/matplotlib/axes/_base.pyi
Line 228 in b766c96
def get_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 unnecessary is None
checks.
Expected outcome
type checkers should not warn of unnecessary is 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
Metadata
Metadata
Assignees
Labels
Good first issueOpen a pull request against these issues if there are no active ones!Open a pull request against these issues if there are no active ones!topic: typing