From afcb46655a9cd35f601373e70d233ee5a5d14eaf Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:49:50 -0700 Subject: [PATCH] graphlib: add in py39 (#4268) Co-authored-by: hauntsaninja <> --- stdlib/3.9/graphlib.pyi | 15 +++++++++++++++ stdlib/3/functools.pyi | 11 ----------- 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 stdlib/3.9/graphlib.pyi diff --git a/stdlib/3.9/graphlib.pyi b/stdlib/3.9/graphlib.pyi new file mode 100644 index 000000000..d1ecb62a9 --- /dev/null +++ b/stdlib/3.9/graphlib.pyi @@ -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): ... diff --git a/stdlib/3/functools.pyi b/stdlib/3/functools.pyi index beccc37a1..a520156d9 100644 --- a/stdlib/3/functools.pyi +++ b/stdlib/3/functools.pyi @@ -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]: ...