Skip to content

[networkx] Return the input graph type from compose_all - #16555

Open
dannyshafer wants to merge 1 commit into
python:mainfrom
dannyshafer:networkx-compose-all-type
Open

dannyshafer wants to merge 1 commit into
python:mainfrom
dannyshafer:networkx-compose-all-type

Conversation

@dannyshafer

@dannyshafer dannyshafer commented Oct 17, 2026 •

Copy link
Copy Markdown

Closes #16546

compose_all builds its result with G.__class__() from the first graph, so it returns the same graph type as its input (upstream).

Written with Claude Code (an AI coding agent).

@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

scipy-stubs (https://github.com/scipy/scipy-stubs)
+ tests/misc/test_submodules_empty.pyi:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

This branch has not been deployed

No deployments
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.

nx.compose_all should return the type of its first argument

2 participants