diff --git a/stubs/networkx/networkx/algorithms/cycles.pyi b/stubs/networkx/networkx/algorithms/cycles.pyi index 0c4d9944f..2890429d4 100644 --- a/stubs/networkx/networkx/algorithms/cycles.pyi +++ b/stubs/networkx/networkx/algorithms/cycles.pyi @@ -1,8 +1,8 @@ -from _typeshed import Incomplete from collections.abc import Generator +from typing import Literal from networkx.classes.digraph import DiGraph -from networkx.classes.graph import Graph, _Node +from networkx.classes.graph import Graph, _NBunch, _Node from networkx.utils.backends import _dispatchable __all__ = [ @@ -16,23 +16,18 @@ __all__ = [ ] @_dispatchable -def cycle_basis(G: Graph[_Node], root: _Node | None = None): ... +def cycle_basis(G: Graph[_Node], root: _Node | None = None) -> list[list[_Node]]: ... @_dispatchable -def simple_cycles(G: Graph[_Node], length_bound: int | None = None) -> Generator[Incomplete, Incomplete, None]: ... - -class _NeighborhoodCache(dict[Incomplete, Incomplete]): - G: Incomplete - - def __init__(self, G) -> None: ... - def __missing__(self, v): ... - +def simple_cycles(G: Graph[_Node], length_bound: int | None = None) -> Generator[list[_Node]]: ... @_dispatchable -def chordless_cycles(G: DiGraph[_Node], length_bound: int | None = None) -> Generator[Incomplete, Incomplete, None]: ... +def chordless_cycles(G: DiGraph[_Node], length_bound: int | None = None) -> Generator[list[_Node]]: ... @_dispatchable -def recursive_simple_cycles(G: DiGraph[_Node]): ... +def recursive_simple_cycles(G: DiGraph[_Node]) -> list[list[_Node]]: ... @_dispatchable -def find_cycle(G: Graph[_Node], source=None, orientation=None): ... +def find_cycle( + G: Graph[_Node], source: _NBunch[_Node] = None, orientation: Literal["original", "reverse", "ignore"] | None = None +): ... @_dispatchable -def minimum_cycle_basis(G: Graph[_Node], weight: str | None = None): ... +def minimum_cycle_basis(G: Graph[_Node], weight: str | None = None) -> list[list[_Node]]: ... @_dispatchable -def girth(G) -> float | int: ... +def girth(G: Graph[_Node]) -> float | int: ... # accepts any graph type