Skip to content
Discussion options

You must be logged in to vote

This can happen is there is a stub package for type-hints, but the actual runtime implementation is non-generic. You can work around this by defining your child class like this:

from typing import TYPE_CHECKING

class MyGraph(nx.DiGraph[NodeType] if TYPE_CHECKING else nx.DiGraph):
    ...

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@patschmidt2
Comment options

@Daraan
Comment options

Answer selected by patschmidt2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants