graphlib: add in py39 (#4268)

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2020-06-26 11:49:50 -07:00
committed by GitHub
parent b05adddf5a
commit afcb46655a
2 changed files with 15 additions and 11 deletions

15
stdlib/3.9/graphlib.pyi Normal file
View File

@@ -0,0 +1,15 @@
from typing import Generic, Iterable, Mapping, Optional, Tuple, TypeVar
_T = TypeVar("_T")
class TopologicalSorter(Generic[_T]):
def __init__(self, graph: Optional[Mapping[_T, Iterable[_T]]] = ...) -> None: ...
def add(self, node: _T, *predecessors: _T) -> None: ...
def prepare(self) -> None: ...
def is_active(self) -> bool: ...
def __bool__(self) -> bool: ...
def done(self, *nodes: _T) -> None: ...
def get_ready(self) -> Tuple[_T, ...]: ...
def static_order(self) -> Iterable[_T]: ...
class CycleError(ValueError): ...

View File

@@ -99,15 +99,4 @@ if sys.version_info >= (3, 8):
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): ...
def cache(__user_function: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...