Skip to content

Commit 336140b

Browse files
authored
Add edges() override in MultiGraph to support the "keys" argument (#13567)
1 parent 1e71351 commit 336140b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

stubs/networkx/networkx/classes/multigraph.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from typing_extensions import TypeAlias
55
from networkx.classes.coreviews import MultiAdjacencyView
66
from networkx.classes.graph import Graph, _Node
77
from networkx.classes.multidigraph import MultiDiGraph
8+
from networkx.classes.reportviews import OutMultiEdgeView
89

910
_MultiEdge: TypeAlias = tuple[_Node, _Node, int] # noqa: Y047
1011

@@ -23,3 +24,5 @@ class MultiGraph(Graph[_Node]):
2324
def to_directed(self, as_view: bool = False) -> MultiDiGraph[_Node]: ...
2425
def to_undirected(self, as_view: bool = False) -> MultiGraph[_Node]: ...
2526
def number_of_edges(self, u: _Node | None = None, v: _Node | None = None) -> int: ...
27+
@cached_property
28+
def edges(self) -> OutMultiEdgeView[_Node]: ...

0 commit comments

Comments
 (0)