mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
toposort: Make argument types less restrictive (#6531)
This commit is contained in:
@@ -1 +1 @@
|
||||
version = "1.6.*"
|
||||
version = "1.7"
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
from typing import Any, Iterator, TypeVar
|
||||
from _typeshed import SupportsItems
|
||||
from typing import Any, Iterable, Iterator, TypeVar
|
||||
from typing_extensions import Protocol
|
||||
|
||||
_KT_co = TypeVar("_KT_co", covariant=True)
|
||||
_VT_co = TypeVar("_VT_co", covariant=True)
|
||||
_T = TypeVar("_T")
|
||||
|
||||
class _SupportsItemsAndLen(SupportsItems[_KT_co, _VT_co], Protocol[_KT_co, _VT_co]):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
class CircularDependencyError(ValueError):
|
||||
data: dict[Any, set[Any]]
|
||||
def __init__(self, data: dict[Any, set[Any]]) -> None: ...
|
||||
|
||||
def toposort(data: dict[_T, set[_T]]) -> Iterator[set[_T]]: ...
|
||||
def toposort_flatten(data: dict[_T, set[_T]], sort: bool = ...) -> list[_T]: ...
|
||||
def toposort(data: _SupportsItemsAndLen[_T, Iterable[_T]]) -> Iterator[set[_T]]: ...
|
||||
def toposort_flatten(data: _SupportsItemsAndLen[_T, Iterable[_T]], sort: bool = ...) -> list[_T]: ...
|
||||
|
||||
Reference in New Issue
Block a user