use Self in async context managers (#5724)

This commit is contained in:
Akuli
2021-07-06 09:47:49 +03:00
committed by GitHub
parent ff2b92f340
commit 42247feefb
3 changed files with 7 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
import ssl
import sys
from _typeshed import FileDescriptorLike
from _typeshed import FileDescriptorLike, Self
from abc import ABCMeta, abstractmethod
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload
@@ -57,7 +57,7 @@ class TimerHandle(Handle):
class AbstractServer:
def close(self) -> None: ...
if sys.version_info >= (3, 7):
async def __aenter__(self: _T) -> _T: ...
async def __aenter__(self: Self) -> Self: ...
async def __aexit__(self, *exc: Any) -> None: ...
def get_loop(self) -> AbstractEventLoop: ...
def is_serving(self) -> bool: ...