mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 05:22:23 +08:00
(a)next only requires __(a)next__, not Iterator (#6036)
This commit is contained in:
@@ -6,7 +6,7 @@ import array
|
||||
import mmap
|
||||
import sys
|
||||
from os import PathLike
|
||||
from typing import AbstractSet, Any, Container, Iterable, Protocol, Tuple, TypeVar, Union
|
||||
from typing import AbstractSet, Any, Awaitable, Container, Iterable, Protocol, Tuple, TypeVar, Union
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
_KT = TypeVar("_KT")
|
||||
@@ -26,6 +26,14 @@ Self = TypeVar("Self") # noqa Y001
|
||||
class IdentityFunction(Protocol):
|
||||
def __call__(self, __x: _T) -> _T: ...
|
||||
|
||||
# stable
|
||||
class SupportsNext(Protocol[_T_co]):
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
# stable
|
||||
class SupportsAnext(Protocol[_T_co]):
|
||||
def __anext__(self) -> Awaitable[_T_co]: ...
|
||||
|
||||
class SupportsLessThan(Protocol):
|
||||
def __lt__(self, __other: Any) -> bool: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user