Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions stubs/networkx/networkx/relabel.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections.abc import Hashable, Mapping
from collections.abc import Callable, Hashable, Mapping
from typing import Literal, TypeVar, overload

from networkx.classes.digraph import DiGraph
Expand All @@ -13,13 +13,15 @@ _Y = TypeVar("_Y", bound=Hashable)
__all__ = ["convert_node_labels_to_integers", "relabel_nodes"]

@overload
def relabel_nodes(G: MultiDiGraph[_X], mapping: Mapping[_X, _Y], copy: bool = True) -> MultiDiGraph[_X | _Y]: ...
def relabel_nodes(
G: MultiDiGraph[_X], mapping: Mapping[_X, _Y] | Callable[[_X], _Y], copy: bool = True
) -> MultiDiGraph[_X | _Y]: ...
@overload
def relabel_nodes(G: DiGraph[_X], mapping: Mapping[_X, _Y], copy: bool = True) -> DiGraph[_X | _Y]: ...
def relabel_nodes(G: DiGraph[_X], mapping: Mapping[_X, _Y] | Callable[[_X], _Y], copy: bool = True) -> DiGraph[_X | _Y]: ...
@overload
def relabel_nodes(G: MultiGraph[_X], mapping: Mapping[_X, _Y], copy: bool = True) -> MultiGraph[_X | _Y]: ...
def relabel_nodes(G: MultiGraph[_X], mapping: Mapping[_X, _Y] | Callable[[_X], _Y], copy: bool = True) -> MultiGraph[_X | _Y]: ...
@overload
def relabel_nodes(G: Graph[_X], mapping: Mapping[_X, _Y], copy: bool = True) -> Graph[_X | _Y]: ...
def relabel_nodes(G: Graph[_X], mapping: Mapping[_X, _Y] | Callable[[_X], _Y], copy: bool = True) -> Graph[_X | _Y]: ...

@_dispatchable
def convert_node_labels_to_integers(
Expand Down
Loading