Skip to content

typing: Add peek method to BinaryIO (#3951) #3957

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/3/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
class BinaryIO(IO[bytes]):
# TODO readinto
# TODO read1?
# TODO peek?
def peek(self, n: int = ...) -> bytes: ...
@overload
@abstractmethod
def write(self, s: bytearray) -> int: ...
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_whitelists/py35.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ sre_compile.dis
subprocess.check_output
tracemalloc.Filter.__init__
typing.AbstractSet.isdisjoint
typing.BinaryIO.peek
typing.Coroutine.cr_await
typing.Coroutine.cr_code
typing.Coroutine.cr_frame
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_whitelists/py36.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ typing.AsyncGenerator.ag_await
typing.AsyncGenerator.ag_code
typing.AsyncGenerator.ag_frame
typing.AsyncGenerator.ag_running
typing.BinaryIO.peek
typing.Coroutine.cr_await
typing.Coroutine.cr_code
typing.Coroutine.cr_frame
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_whitelists/py37.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ tracemalloc.Traceback.format
types.ClassMethodDescriptorType.__get__
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__
typing.BinaryIO.peek
typing.runtime_checkable
unittest.async_case
urllib.parse.parse_qs
Expand Down
1 change: 1 addition & 0 deletions tests/stubtest_whitelists/py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ types.ClassMethodDescriptorType.__get__
types.CodeType.replace
types.MethodDescriptorType.__get__
types.WrapperDescriptorType.__get__
typing.BinaryIO.peek
unittest.TestCase.addCleanup
unittest.case.TestCase.addCleanup
unittest.doModuleCleanups
Expand Down