Skip to content

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

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
dannyshafer:networkx-compose-all-type
Oct 20, 2026
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
dannyshafer:networkx-compose-all-type

Conversation

@dannyshafer

@dannyshafer dannyshafer commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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

@JelleZijlstra
JelleZijlstra merged commit ad36363 into python:main Oct 20, 2026
74 checks passed
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

3 participants