Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-141004: Document PyBytes_Repr and PyBytes_DecodeEscape#141407
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
ZeroIntensity commented Nov 11, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Doc/c-api/bytes.rst Outdated
| Get the string representation of *bytes*. This function is used to | ||
| implement :meth:`!bytes.__repr__` in Python. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Co-authored-by: Stan Ulbrych <[email protected]>
StanFromIreland left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
37e2762 into python:mainUh oh!
There was an error while loading. Please reload this page.
Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Sorry, @ZeroIntensity, I could not cleanly backport this to |
Sorry, @ZeroIntensity, I could not cleanly backport this to |
GH-141440 is a backport of this pull request to the 3.14 branch. |
…ythonGH-141407) Co-authored-by: Stan Ulbrych <[email protected]> (cherry picked from commit 37e2762)
…cape` (pythonGH-141407) (cherry picked from commit 37e2762) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
GH-141441 is a backport of this pull request to the 3.13 branch. |
…ythonGH-141407) Co-authored-by: Stan Ulbrych <[email protected]> (cherry picked from commit 37e2762)
…cape` (pythonGH-141407) (cherry picked from commit 37e2762) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Stan Ulbrych <[email protected]>
…ythonGH-141407) Co-authored-by: Stan Ulbrych <[email protected]>
📚 Documentation preview 📚: https://cpython-previews--141407.org.readthedocs.build/en/141407/c-api/bytes.html#c.PyBytes_Repr