gh-90533: Implement BytesIO.peek() by marcelm · Pull Request #30808 · python/cpython · GitHub

github.com

Tin mới

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

python/cpython:main

marcelm:fix-issue-46375

b833b83 Implement BytesIO.peek() marcelm Jan 22, 2022

50a2cfb 📜🤖 Added by blurb_it. blurb-it[bot] Apr 10, 2022

eaa7672 Document BytesIO.peek() marcelm Nov 9, 2022

00457ae Implement with the help of read_bytes() marcelm Nov 9, 2022

882579d Add to What’s New marcelm Jul 8, 2023

c1eed72 versionadded: 3.12 -> 3.13 marcelm Jul 8, 2023

afc200c Remove unused variable marcelm Jul 8, 2023

79ab9a4 Test tell() after peek() marcelm Sep 22, 2023

b493914 Update docs, factor out peek_bytes, semantics marcelm Sep 22, 2023

2a1c85c Update Misc/NEWS.d/next/Library/2022-04-10-20-10-59.bpo-46375.8j1ogZ.rst marcelm Sep 28, 2023

d398717 Update Modules/_io/bytesio.c marcelm Sep 28, 2023

26d1e81 Update Modules/_io/bytesio.c marcelm Sep 28, 2023

9a19ff9 Use SemBr marcelm Sep 28, 2023

9300ade Update Doc/whatsnew/3.13.rst marcelm Sep 28, 2023

d214089 Apply suggestions from code review marcelm Sep 28, 2023

d6691b8 Use a context manager around memio in test_peek marcelm Sep 28, 2023

3e51adb Add more tests for tell() after peek() marcelm Sep 28, 2023

3661b65 Document why size < 0 can happen marcelm Sep 28, 2023

cd40d77 Update Modules/_io/bytesio.c marcelm Sep 29, 2023

04372bd Do not update pos if peek_bytes failed marcelm Sep 29, 2023

6b9ae8c Size can be negative after truncate or seek marcelm Sep 29, 2023

f7406f6 Test with size<0 and size>len(buf) marcelm Sep 29, 2023

d9528e2 Test peek() after write() marcelm Sep 29, 2023

bc8134b Document BufferedReader.peek and BytesIO.peek similarly marcelm Sep 29, 2023

b6ffca8 Comment marcelm Sep 29, 2023

5fe5645 Make it more explicit that size is ignored marcelm Sep 29, 2023

4126a64 Return an empty bytes object for size=0 marcelm Oct 23, 2023

1ea40c2 Simplify marcelm Oct 23, 2023

77e04d6 Test peek(3) and peek(5) marcelm Oct 23, 2023