from _typeshed import Incomplete
from collections.abc import Generator, Iterator

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): ...
