-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add missing methods methods in aiofiles #4734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4a404c0
fix aiofiles stubs
MKuranowski 63013ee
switch io.BinaryIO to typing.BinaryIO
MKuranowski a1530cd
swap typing.Literal to typing_extensions.Literal
MKuranowski 18efc0e
fix overload overlap in open function
MKuranowski e43b9a3
Fix filename generics
MKuranowski bf543a3
add missing loop and executor arguments to aiofiles.open
MKuranowski d5fd6ac
Remove generics from async files
MKuranowski d8d8959
Fix async file-like read, readline and write signatures
MKuranowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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: ... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove these arguments from some overloads?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's a mistake. Pushed a fix.