Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Bug]: type annotation ofAxes.get_legend() missesNone #30318

Closed
Labels
Good first issueOpen a pull request against these issues if there are no active ones!topic: typing
Milestone
@bersbersbers

Description

@bersbersbers

Bug summary

Implementation:

defget_legend(self):
"""Return the `.Legend` instance, or None if no legend is defined."""
returnself.legend_

Type hints:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueOpen a pull request against these issues if there are no active ones!topic: typing

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp