diff --git a/stubs/networkx/networkx/generators/interval_graph.pyi b/stubs/networkx/networkx/generators/interval_graph.pyi index 89857e689d47..c6f841723d4b 100644 --- a/stubs/networkx/networkx/generators/interval_graph.pyi +++ b/stubs/networkx/networkx/generators/interval_graph.pyi @@ -1,10 +1,12 @@ -from _typeshed import Incomplete -from collections.abc import Iterable +from collections.abc import Iterable, Sequence +from typing import TypeVar from networkx.classes.graph import Graph from networkx.utils.backends import _dispatchable __all__ = ["interval_graph"] +_T = TypeVar("_T") + @_dispatchable -def interval_graph(intervals: Iterable[Incomplete]) -> Graph[Incomplete]: ... +def interval_graph(intervals: Iterable[Sequence[_T]]) -> Graph[tuple[_T, ...]]: ... diff --git a/stubs/networkx/networkx/generators/lattice.pyi b/stubs/networkx/networkx/generators/lattice.pyi index fe2c3468bdeb..9092285d6f3e 100644 --- a/stubs/networkx/networkx/generators/lattice.pyi +++ b/stubs/networkx/networkx/generators/lattice.pyi @@ -23,7 +23,7 @@ def triangular_lattice_graph( periodic: bool = False, with_positions: bool = True, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None, -) -> Graph[Incomplete]: ... +) -> Graph[tuple[int, int]]: ... @_dispatchable def hexagonal_lattice_graph( m: int, @@ -31,4 +31,4 @@ def hexagonal_lattice_graph( periodic: bool = False, with_positions: bool = True, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None, -) -> Graph[Incomplete]: ... +) -> Graph[tuple[int, int]]: ...