-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed as duplicate of#14877
Description
In the current version of typeshed, networkx.Graph is defined as a generic type:
| _Node = TypeVar("_Node", bound=Hashable) |
| class Graph(Collection[_Node]): |
However, networkx.Graph is not a generic type at all:
https://github.com/networkx/networkx/blob/1660ac379a1c10e3d413760785dbc5cd2186a125/networkx/classes/graph.py#L71
and there'n no explicit __class_getitem__ in that class.
Therefore, when I use this type as hinted by the stubs, I get runtime error TypeError: type 'Graph' is not subscriptable.
I checked for similar issues, including #14389 and #12186, but none of them seem to address this problem.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels