File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
stubs/networkx/networkx/utils Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 1- from _typeshed import Incomplete
2- from collections . abc import Generator , Iterator
1+ from collections . abc import Generator , Iterable , Iterator , Mapping
2+ from typing import Generic , TypeVar
33
4- class UnionFind :
5- parents : Incomplete
6- weights : Incomplete
7- def __init__ (self , elements = None ) -> None : ...
8- def __getitem__ (self , object ): ...
9- def __iter__ (self ) -> Iterator [Incomplete ]: ...
10- def to_sets (self ) -> Generator [Incomplete , Incomplete , None ]: ...
11- def union (self , * objects ): ...
4+ _T = TypeVar ("_T" )
5+
6+ class UnionFind (Generic [_T ]):
7+ parents : Mapping [_T , _T ]
8+ weights : Mapping [_T , int ]
9+ def __init__ (self , elements : Iterable [_T ] | None = None ) -> None : ...
10+ def __getitem__ (self , object : _T ) -> _T : ...
11+ def __iter__ (self ) -> Iterator [_T ]: ...
12+ def to_sets (self ) -> Generator [set [_T ]]: ...
13+ def union (self , * objects : _T ) -> None : ...
You can’t perform that action at this time.
0 commit comments