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 FileDescriptorLike
from _typeshed import FileDescriptorLike, Self
from types import TracebackType
from typing import Any, Iterable, List, Optional, Tuple, Type
@@ -101,7 +101,7 @@ if sys.platform != "linux" and sys.platform != "win32":
if sys.platform == "linux":
class epoll(object):
def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ...
def __enter__(self) -> epoll: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self,
exc_type: Optional[Type[BaseException]] = ...,