Add aiofiles.os.scandir (#9280)

This commit is contained in:
Maxwell G
2022-11-25 20:36:00 -06:00
committed by GitHub
parent 087917f2b8
commit 553e7d46f0
2 changed files with 12 additions and 3 deletions

View File

@@ -37,6 +37,7 @@ aiofiles.os.mkdir
aiofiles.os.makedirs
aiofiles.os.rmdir
aiofiles.os.removedirs
aiofiles.os.scandir
aiofiles.ospath.exists
aiofiles.ospath.isfile
aiofiles.ospath.isdir

View File

@@ -1,9 +1,9 @@
import sys
from _typeshed import StrOrBytesPath
from _typeshed import GenericPath, StrOrBytesPath
from asyncio.events import AbstractEventLoop
from collections.abc import Sequence
from os import stat_result
from typing import Any, overload
from os import _ScandirIterator, stat_result
from typing import Any, AnyStr, overload
from typing_extensions import TypeAlias
from aiofiles import ospath
@@ -51,6 +51,14 @@ async def rmdir(
path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Any = ...
) -> None: ...
async def removedirs(name: StrOrBytesPath, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> None: ...
@overload
async def scandir(path: None = ..., *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> _ScandirIterator[str]: ...
@overload
async def scandir(path: int, *, loop: AbstractEventLoop | None = ..., executor: Any = ...) -> _ScandirIterator[str]: ...
@overload
async def scandir(
path: GenericPath[AnyStr], *, loop: AbstractEventLoop | None = ..., executor: Any = ...
) -> _ScandirIterator[AnyStr]: ...
if sys.platform != "win32":
@overload