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
22 changes: 12 additions & 10 deletions stubs/networkx/networkx/utils/union_find.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from _typeshed import Incomplete
from collections.abc import Generator, Iterator
from collections.abc import Generator, Iterable, Iterator, Mapping
from typing import Generic, TypeVar

class UnionFind:
parents: Incomplete
weights: Incomplete
def __init__(self, elements=None) -> None: ...
def __getitem__(self, object): ...
def __iter__(self) -> Iterator[Incomplete]: ...
def to_sets(self) -> Generator[Incomplete, Incomplete, None]: ...
def union(self, *objects): ...
_T = TypeVar("_T")

class UnionFind(Generic[_T]):
parents: Mapping[_T, _T]
weights: Mapping[_T, int]
def __init__(self, elements: Iterable[_T] | None = None) -> None: ...
def __getitem__(self, object: _T) -> _T: ...
def __iter__(self) -> Iterator[_T]: ...
def to_sets(self) -> Generator[set[_T]]: ...
def union(self, *objects: _T) -> None: ...