diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 6c4dcc25302e..930d76213a00 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -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: ... diff --git a/tests/stubtest_whitelists/py35.txt b/tests/stubtest_whitelists/py35.txt index 4a5b6e5758d2..a0a3ed36c391 100644 --- a/tests/stubtest_whitelists/py35.txt +++ b/tests/stubtest_whitelists/py35.txt @@ -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 diff --git a/tests/stubtest_whitelists/py36.txt b/tests/stubtest_whitelists/py36.txt index a80097857f90..4788afc09f61 100644 --- a/tests/stubtest_whitelists/py36.txt +++ b/tests/stubtest_whitelists/py36.txt @@ -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 diff --git a/tests/stubtest_whitelists/py37.txt b/tests/stubtest_whitelists/py37.txt index 3da982868a7b..725c48b6bf40 100644 --- a/tests/stubtest_whitelists/py37.txt +++ b/tests/stubtest_whitelists/py37.txt @@ -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 diff --git a/tests/stubtest_whitelists/py38.txt b/tests/stubtest_whitelists/py38.txt index 7dd11a8e50cb..fb07ebd9f070 100644 --- a/tests/stubtest_whitelists/py38.txt +++ b/tests/stubtest_whitelists/py38.txt @@ -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