Skip to content
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

Improve handling of create_using to allow Mixins of type Protocol #6244

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

dschult
Copy link
Member

@dschult dschult commented Nov 29, 2022

switch create_using handling to isinstance(_, type) instead of type(_) is type

Fixes: #6243

@adam2392
Copy link
Contributor

Is there anything blocking this PR?

@rossbar
Copy link
Contributor

rossbar commented Dec 13, 2022

The main consideration is that empty_graph is used extensively (both within the library and user code), so this change has the potential to introduce subtle bugs that aren't caught by the test suite. NetworkX 3.0 is slated to come out in the very near future, so this PR is waiting until after that release in the interest of risk-avoidance.

@adam2392
Copy link
Contributor

Ah I see! Exciting milestone for networkx!

Copy link
Member

@MridulS MridulS left a comment

Choose a reason for hiding this comment

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

3.0 is out 🥳

Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

Let's give it a shot!

@rossbar rossbar merged commit 0a9a40f into networkx:main Jan 18, 2023
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
…tworkx#6244)

switch create_using handling to `isinstance(_, type)` instead of `type(_) is type`
@dschult dschult deleted the fix_create_using_logic branch July 5, 2023 19:29
@jarrodmillman jarrodmillman added this to the 3.2 milestone Jul 20, 2023
dschult added a commit to BrunoBaldissera/networkx that referenced this pull request Oct 23, 2023
…tworkx#6244)

switch create_using handling to `isinstance(_, type)` instead of `type(_) is type`
cvanelteren pushed a commit to cvanelteren/networkx that referenced this pull request Apr 22, 2024
…tworkx#6244)

switch create_using handling to `isinstance(_, type)` instead of `type(_) is type`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Subclassing networkx with Mixin class defined with Python Protocol results in an error during graph creation
5 participants