Skip to content
Prev Previous commit
Next Next commit
Use _typeshed.Anext
  • Loading branch information
AlexWaygood authored Mar 15, 2022
commit 825910a9de2ae3cb519bac1d097b76914930e485
5 changes: 1 addition & 4 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1075,13 +1075,10 @@ if sys.version_info >= (3, 10):
class _SupportsSynchronousAnext(Protocol[_AwaitableT_co]):
def __anext__(self) -> _AwaitableT_co: ...

class _SupportsAwaitableAnext(Protocol[_T_co]):
def __anext__(self) -> Awaitable[_T_co]: ...

@overload
def anext(__i: _SupportsSynchronousAnext[_AwaitableT]) -> _AwaitableT: ...
@overload
async def anext(__i: _SupportsAwaitableAnext[_T], default: _VT) -> _T | _VT: ...
async def anext(__i: SupportsAnext[_T], default: _VT) -> _T | _VT: ...

# TODO: `compile` has a more precise return type in reality; work on a way of expressing that?
if sys.version_info >= (3, 8):
Expand Down