Skip to content

networkx: Add symbols from python-type-stubs #14084

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

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

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented May 16, 2025

Extracted from #14038
Adds symbols found in https://github.com/microsoft/python-type-stubs/tree/main/stubs/networkx but not in our stubs.
Except for def *_impl(...) and chaini = itertools.chain.from_iterable

This will help differentiate between additions and modifications in the git diff.

This comment has been minimized.

@srittau
Copy link
Collaborator

srittau commented May 16, 2025

stubs/networkx/networkx/algorithms/community/lukes.pyi (3.12): ParseError: Default value for D_EDGE_VALUE: Final can only be '...' or a legal Literal parameter, got LITERAL(1.0)

I'm sorry, pytype, I don't think you are correct here. Maybe just add networkx to pytype's exclude list?

@Avasam
Copy link
Collaborator Author

Avasam commented May 16, 2025

It's somewhat correct.
D_EDGE_VALUE: Final = 1.0 means the type is Literal[1.0]. And using a float in Literal is out of spec afaik. Even pyright/pylance doesn't do it.

image
image

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