mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 13:32:26 +08:00
functools: add TopologicalSorter for py39 (#4068)
* functools: add TopologicalSorter for py39 * fix flake8 error Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -97,3 +97,15 @@ if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def __get__(self, instance: _S, owner: Optional[Type[Any]] = ...) -> _T: ...
|
||||
def __set_name__(self, owner: Type[Any], name: str) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
class TopologicalSorter(Generic[_T]):
|
||||
def __init__(self, graph: Optional[Dict[_T, Iterable[_T]]] = ...) -> None: ...
|
||||
def add(self, node: _T, *predecessors: _T) -> None: ...
|
||||
def prepare(self) -> None: ...
|
||||
def is_active(self) -> bool: ...
|
||||
def done(self, *nodes: _T) -> None: ...
|
||||
def get_ready(self) -> Tuple[_T, ...]: ...
|
||||
def static_order(self) -> Iterable[_T]: ...
|
||||
|
||||
class CycleError(ValueError): ...
|
||||
|
||||
Reference in New Issue
Block a user