Use _typeshed.Self with __enter__ (#5717)

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Anton Grübel
2021-07-01 12:32:32 +02:00
committed by GitHub
parent 04f0113d16
commit 96e0660fba
12 changed files with 44 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
import sys
from _typeshed import ReadableBuffer, WriteableBuffer
from _typeshed import ReadableBuffer, Self, WriteableBuffer
from collections.abc import Iterable
from enum import IntEnum, IntFlag
from io import RawIOBase
@@ -545,7 +545,7 @@ class socket(_socket.socket):
proto: int = ...,
fileno: Optional[int] = ...,
) -> None: ...
def __enter__(self: _T) -> _T: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: object) -> None: ...
def dup(self: _T) -> _T: ... # noqa: F811
def accept(self) -> tuple[socket, _RetAddress]: ...