Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix todo in inspect #13129

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix todo in inspect #13129

wants to merge 2 commits into from

Conversation

kbaikov
Copy link
Contributor

@kbaikov kbaikov commented Nov 26, 2024

latest mypy seems to accept it.

This comment has been minimized.

# seem to be supporting this at the moment:
# _ClassTreeItem = list[_ClassTreeItem] | Tuple[type, Tuple[type, ...]]
def getclasstree(classes: list[type], unique: bool = False) -> list[Any]: ...
_ClassTreeItem: TypeAlias = list[_ClassTreeItem] | tuple[type, tuple[type, ...]]
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that it ever returns a tuple. See:

But, the list contains tuple items, see https://github.com/python/cpython/blob/71ede1142ddad2d31cc966b8fe4a5aff664f4d53/Lib/inspect.py#L1161

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants