Improve the definition of os._ScandirIterator (#13013)

This commit is contained in:
Alex Waygood
2024-11-15 21:33:32 +00:00
committed by GitHub
parent 8cdc1c141b
commit 6d21e34d78

View File

@@ -22,7 +22,6 @@ from _typeshed import (
from abc import abstractmethod
from builtins import OSError
from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence
from contextlib import AbstractContextManager
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
from subprocess import Popen
from types import TracebackType
@@ -794,9 +793,12 @@ def replace(
src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = None, dst_dir_fd: int | None = None
) -> None: ...
def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ...
class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_ScandirIterator[AnyStr], None]):
@final
class _ScandirIterator(Generic[AnyStr]):
def __del__(self) -> None: ...
def __iter__(self) -> Self: ...
def __next__(self) -> DirEntry[AnyStr]: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: Unused) -> None: ...
def close(self) -> None: ...