Skip to content

[networkx] Return the input graph type from transitive_closure - #16556

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

JelleZijlstra merged 1 commit into
python:mainfrom
dannyshafer:networkx-transitive-closure-type

Conversation

@dannyshafer

@dannyshafer dannyshafer commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #16547

transitive_closure starts from G.copy(), 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

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

@JelleZijlstra
JelleZijlstra merged commit 14f71ed 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.transitive_closure should return the same Graph type as it took in!

3 participants