mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
graphlib: update for py311 (#7317)
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import sys
|
||||
from _typeshed import SupportsItems
|
||||
from typing import Generic, Iterable, TypeVar
|
||||
from typing import Any, Generic, Iterable, TypeVar
|
||||
|
||||
__all__ = ["TopologicalSorter", "CycleError"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
from types import GenericAlias
|
||||
|
||||
class TopologicalSorter(Generic[_T]):
|
||||
def __init__(self, graph: SupportsItems[_T, Iterable[_T]] | None = ...) -> None: ...
|
||||
def add(self, node: _T, *predecessors: _T) -> None: ...
|
||||
@@ -14,5 +18,7 @@ class TopologicalSorter(Generic[_T]):
|
||||
def done(self, *nodes: _T) -> None: ...
|
||||
def get_ready(self) -> tuple[_T, ...]: ...
|
||||
def static_order(self) -> Iterable[_T]: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class CycleError(ValueError): ...
|
||||
|
||||
Reference in New Issue
Block a user