Skip to content

Fix: allow graph subclasses to have additional arguments - #8369

Merged
dschult merged 3 commits into
networkx:mainfrom
eriknw:fix_subclass_extra_args
Dec 6, 2025
Merged

dschult merged 3 commits into
networkx:mainfrom
eriknw:fix_subclass_extra_args

Conversation

@eriknw

@eriknw eriknw commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Closes: #8367

Oops, my bad! Supporting user graph types is kind of important :)

I wasn't sure where to put the test, but it felt important to add at least one test for this.

My bandwidth is limited to make requested changes in a timely manner, so maintainers please feel free to directly update this PR. I'll do my best though and will try to reply to comments/questions.

@rossbar rossbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks @eriknw !

Comment thread networkx/classes/tests/test_graph.py Resolved
@rossbar rossbar added this to the 3.6.1 milestone Dec 5, 2025

@dschult dschult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!
Thanks @eriknw for the quick fix.
And Thanks @JEZiegler for the report!!

@dschult
dschult merged commit 75bdd73 into networkx:main Dec 6, 2025
@dschult dschult modified the milestones: 3.6.1, 3.6 Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Providing more than one argument to Digraph subclass leads to exception in __new__

4 participants