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 FileDescriptor, FileDescriptorLike
from _typeshed import FileDescriptor, FileDescriptorLike, Self
from abc import ABCMeta, abstractmethod
from typing import Any, List, Mapping, NamedTuple, Optional, Tuple
@@ -26,7 +26,7 @@ class BaseSelector(metaclass=ABCMeta):
def get_key(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
@abstractmethod
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
def __enter__(self) -> BaseSelector: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
class SelectSelector(BaseSelector):