This repository has been archived by the owner on Dec 27, 2021. It is now read-only.
forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing methods methods in aiofiles (python#4734)
* fix aiofiles stubs * switch io.BinaryIO to typing.BinaryIO * swap typing.Literal to typing_extensions.Literal * fix overload overlap in open function * Fix filename generics * add missing loop and executor arguments to aiofiles.open * Remove generics from async files * Fix async file-like read, readline and write signatures
- Loading branch information
1 parent
0e002f4
commit 40b44a9
Showing
5 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,41 @@ | ||
from _typeshed import AnyPath, ReadableBuffer, WriteableBuffer | ||
from io import FileIO | ||
from typing import Iterable, List, Optional, Union | ||
|
||
from ..base import AsyncBase | ||
|
||
class AsyncBufferedIOBase(AsyncBase[bytes]): ... | ||
class AsyncBufferedReader(AsyncBufferedIOBase): ... | ||
class AsyncFileIO(AsyncBase[bytes]): ... | ||
class _UnknownAsyncBinaryIO(AsyncBase[bytes]): | ||
async def close(self) -> None: ... | ||
async def flush(self) -> None: ... | ||
async def isatty(self) -> bool: ... | ||
async def read(self, __size: int = ...) -> bytes: ... | ||
async def readinto(self, __buffer: WriteableBuffer) -> Optional[int]: ... | ||
async def readline(self, __size: Optional[int] = ...) -> bytes: ... | ||
async def readlines(self, __hint: int = ...) -> List[bytes]: ... | ||
async def seek(self, __offset: int, __whence: int = ...) -> int: ... | ||
async def seekable(self) -> bool: ... | ||
async def tell(self) -> int: ... | ||
async def truncate(self, __size: Optional[int] = ...) -> int: ... | ||
async def writable(self) -> bool: ... | ||
async def write(self, __b: ReadableBuffer) -> int: ... | ||
async def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ... | ||
def fileno(self) -> int: ... | ||
def readable(self) -> bool: ... | ||
@property | ||
def closed(self) -> bool: ... | ||
@property | ||
def mode(self) -> str: ... | ||
@property | ||
def name(self) -> Union[AnyPath, int]: ... | ||
|
||
class AsyncBufferedIOBase(_UnknownAsyncBinaryIO): | ||
async def read1(self, __size: int = ...) -> bytes: ... | ||
def detach(self) -> FileIO: ... | ||
@property | ||
def raw(self) -> FileIO: ... | ||
|
||
class AsyncBufferedReader(AsyncBufferedIOBase): | ||
async def peek(self, __size: int = ...) -> bytes: ... | ||
|
||
class AsyncFileIO(_UnknownAsyncBinaryIO): | ||
async def readall(self) -> bytes: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,38 @@ | ||
from _typeshed import AnyPath | ||
from typing import BinaryIO, Iterable, List, Optional, Tuple, Union | ||
|
||
from ..base import AsyncBase | ||
|
||
class AsyncTextIOWrapper(AsyncBase[str]): ... | ||
class AsyncTextIOWrapper(AsyncBase[str]): | ||
async def close(self) -> None: ... | ||
async def flush(self) -> None: ... | ||
async def isatty(self) -> bool: ... | ||
async def read(self, __size: Optional[int] = ...) -> str: ... | ||
async def readline(self, __size: int = ...) -> str: ... | ||
async def readlines(self, __hint: int = ...) -> List[str]: ... | ||
async def seek(self, __offset: int, __whence: int = ...) -> int: ... | ||
async def seekable(self) -> bool: ... | ||
async def tell(self) -> int: ... | ||
async def truncate(self, __size: Optional[int] = ...) -> int: ... | ||
async def writable(self) -> bool: ... | ||
async def write(self, __b: str) -> int: ... | ||
async def writelines(self, __lines: Iterable[str]) -> None: ... | ||
def detach(self) -> BinaryIO: ... | ||
def fileno(self) -> int: ... | ||
def readable(self) -> bool: ... | ||
@property | ||
def buffer(self) -> BinaryIO: ... | ||
@property | ||
def closed(self) -> bool: ... | ||
@property | ||
def encoding(self) -> str: ... | ||
@property | ||
def errors(self) -> Optional[str]: ... | ||
@property | ||
def line_buffering(self) -> bool: ... | ||
@property | ||
def newlines(self) -> Union[str, Tuple[str, ...], None]: ... | ||
@property | ||
def name(self) -> Union[AnyPath, int]: ... | ||
@property | ||
def mode(self) -> str: ... |