Skip to content

Commit

Permalink
Improve the definition of os._ScandirIterator (python#13013)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Nov 15, 2024
1 parent 8cdc1c1 commit 6d21e34
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions stdlib/os/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ...

Expand Down

0 comments on commit 6d21e34

Please sign in to comment.