Skip to content

Conversation

@ZeroIntensity
Copy link
Member

@ZeroIntensityZeroIntensity commented Nov 11, 2025

Comment on lines 234 to 235
Get the string representation of *bytes*. This function is used to
implement :meth:`!bytes.__repr__` in Python.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Get the string representation of *bytes*. This function is used to
implement :meth:`!bytes.__repr__` in Python.
Get the string representation of *bytes*.
*bytes* must be a bytes object.
This function is used to implement :meth:`!bytes.__repr__` in Python.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same remark as the other PR, this reads as "segfault if this isn't a bytes object".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, it will lead to undefined behaviour.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yuck! I think we should have a more explicit note then. That definitely surprised me.

Copy link
Member

@StanFromIrelandStanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZeroIntensityZeroIntensity merged commit 37e2762 into python:mainNov 11, 2025
28 checks passed
@ZeroIntensityZeroIntensity deleted the document-pybytes branch November 11, 2025 20:32
@github-project-automationgithub-project-automationbot moved this from Todo to Done in Docs PRsNov 11, 2025
@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @ZeroIntensity, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 37e2762ee12c2d7fc465938d7161a9a0640bd71f 3.14 

@miss-islington-app
Copy link

Sorry, @ZeroIntensity, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 37e2762ee12c2d7fc465938d7161a9a0640bd71f 3.13 

@bedevere-app
Copy link

GH-141440 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14 bugs and security fixes label Nov 12, 2025
ZeroIntensity added a commit to ZeroIntensity/cpython that referenced this pull request Nov 12, 2025
ZeroIntensity added a commit to ZeroIntensity/cpython that referenced this pull request Nov 12, 2025
…cape` (pythonGH-141407) (cherry picked from commit 37e2762) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
@bedevere-app
Copy link

GH-141441 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13 bugs and security fixes label Nov 12, 2025
ZeroIntensity added a commit to ZeroIntensity/cpython that referenced this pull request Nov 12, 2025
ZeroIntensity added a commit to ZeroIntensity/cpython that referenced this pull request Nov 12, 2025
…cape` (pythonGH-141407) (cherry picked from commit 37e2762) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
ZeroIntensity added a commit that referenced this pull request Nov 12, 2025
…H-141407) (GH-141440) * gh-141004: Document `PyBytes_Repr` and `PyBytes_DecodeEscape` (GH-141407) Co-authored-by: Stan Ulbrych <[email protected]> (cherry picked from commit 37e2762)
ZeroIntensity added a commit that referenced this pull request Nov 12, 2025
…H-141407) (GH-141441) * gh-141004: Document `PyBytes_Repr` and `PyBytes_DecodeEscape` (GH-141407) Co-authored-by: Stan Ulbrych <[email protected]> (cherry picked from commit 37e2762)
StanFromIreland added a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants

@ZeroIntensity@StanFromIreland