typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

[networkx] Cannot assign concrete types to `Graph[Hashable]`

Open EarlMilktea opened this issue 1 year ago • 1 comments

Description

Several functions have arguments annotated as Graph[Hashable] or similar (ex. nx.number_of_selfloops).

As Graph is invariant, we encounter false-positive type errors when trying to assign concrete types (say Graph[int]).

EarlMilktea avatar Jun 23 '24 04:06 EarlMilktea

I just encountered this as well

benjamin-kirkbride avatar Jul 01 '24 22:07 benjamin-kirkbride