mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-04 12:35:49 +08:00
[networkx] Graph/MultiGraph inherited methods return Self (#15453)
This commit is contained in:
@@ -100,8 +100,8 @@ class Graph(Collection[_Node]):
|
||||
def copy(self, as_view: bool = False) -> Self: ...
|
||||
def to_directed(self, as_view: bool = False) -> DiGraph[_Node]: ...
|
||||
def to_undirected(self, as_view: bool = False) -> Graph[_Node]: ...
|
||||
def subgraph(self, nodes: _NBunch[_Node]) -> Graph[_Node]: ...
|
||||
def edge_subgraph(self, edges: Iterable[_Edge[_Node]]) -> Graph[_Node]: ...
|
||||
def subgraph(self, nodes: _NBunch[_Node]) -> Self: ...
|
||||
def edge_subgraph(self, edges: Iterable[_Edge[_Node]]) -> Self: ...
|
||||
@overload
|
||||
def size(self, weight: None = None) -> int: ...
|
||||
@overload
|
||||
|
||||
@@ -52,7 +52,7 @@ class MultiGraph(Graph[_Node]):
|
||||
def get_edge_data(
|
||||
self, u: _Node, v: _Node, key: None = None, default: _DefaultT | None = None
|
||||
) -> dict[Hashable, dict[str, Any] | _DefaultT]: ...
|
||||
def copy(self, as_view: bool = False) -> MultiGraph[_Node]: ...
|
||||
def copy(self, as_view: bool = False) -> Self: ...
|
||||
@cached_property
|
||||
# Including subtypes' possible return types for LSP
|
||||
def degree(self) -> MultiDegreeView[_Node] | DiMultiDegreeView[_Node]: ...
|
||||
|
||||
Reference in New Issue
Block a user