stdlib: Add several missing @abstractmethod decorators (#7443)

This commit is contained in:
Alex Waygood
2022-03-07 00:41:13 +00:00
committed by GitHub
parent 2fb9c35ff9
commit 947724a5cb
7 changed files with 29 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ from _typeshed import (
StrPath,
structseq,
)
from abc import abstractmethod
from builtins import OSError
from contextlib import AbstractContextManager
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper as _TextIOWrapper
@@ -371,6 +372,7 @@ class stat_result(structseq[float], tuple[int, int, int, int, int, int, int, flo
@runtime_checkable
class PathLike(Protocol[_AnyStr_co]):
@abstractmethod
def __fspath__(self) -> _AnyStr_co: ...
@overload
@@ -728,6 +730,7 @@ def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> None: ...
class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_ScandirIterator[AnyStr]]):
def __next__(self) -> DirEntry[AnyStr]: ...
def __exit__(self, *args: object) -> None: ...
def close(self) -> None: ...
if sys.version_info >= (3, 7):