mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-27 03:52:19 +08:00
Complete stubtest for aiofiles + fix on Windows (#9184)
This commit is contained in:
@@ -6,7 +6,7 @@ from os import stat_result
|
||||
from typing import Any, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from . import ospath
|
||||
from aiofiles import ospath
|
||||
|
||||
path = ospath
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ from tempfile import TemporaryDirectory, _BytesMode
|
||||
from types import coroutine as coroutine
|
||||
from typing import TypeVar
|
||||
|
||||
from ..base import AsyncBase as AsyncBase
|
||||
from ..threadpool.utils import (
|
||||
from aiofiles.base import AsyncBase as AsyncBase
|
||||
from aiofiles.threadpool.utils import (
|
||||
cond_delegate_to_executor as cond_delegate_to_executor,
|
||||
delegate_to_executor as delegate_to_executor,
|
||||
proxy_property_directly as proxy_property_directly,
|
||||
@@ -17,6 +17,7 @@ _T = TypeVar("_T")
|
||||
class AsyncSpooledTemporaryFile(AsyncBase[_T]):
|
||||
def fileno(self) -> Generator[Incomplete, Incomplete, Incomplete]: ...
|
||||
def rollover(self) -> Generator[Incomplete, Incomplete, Incomplete]: ...
|
||||
async def close(self) -> None: ...
|
||||
async def flush(self) -> None: ...
|
||||
async def isatty(self) -> bool: ...
|
||||
# All must return `AnyStr`:
|
||||
@@ -37,6 +38,8 @@ class AsyncSpooledTemporaryFile(AsyncBase[_T]):
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def newlines(self) -> str: ...
|
||||
@property
|
||||
def softspace(self) -> bool: ...
|
||||
# Both should work with `AnyStr`, like in `tempfile`:
|
||||
async def write(self, s: Incomplete) -> int: ...
|
||||
async def writelines(self, iterable: Iterable[Incomplete]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user