]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-90533: Implement BytesIO.peek() (#150917)
authorMarcel Martin <mail@marcelm.net>
Fri, 26 Jun 2026 11:46:39 +0000 (13:46 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2026 11:46:39 +0000 (13:46 +0200)
commit72cad148cb6bd6ef34f4a377e4618cb73933c9b1
tree651b191044e287219b9e7fd285225d982e81ebfe
parent3ad66bf10dbb929bcf8efd889e56a9b9068319ca
gh-90533: Implement BytesIO.peek() (#150917)

Add io.BytesIO.peek() method to read without advancing position.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Doc/library/io.rst
Doc/whatsnew/3.16.rst
Lib/_pyio.py
Lib/test/test_free_threading/test_io.py
Lib/test/test_io/test_memoryio.py
Misc/NEWS.d/next/Library/2022-04-10-20-10-59.bpo-46375.8j1ogZ.rst [new file with mode: 0644]
Modules/_io/bytesio.c
Modules/_io/clinic/bytesio.c.h