-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
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
Conversation
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 <89152624+StanFromIreland@users.noreply.github.com>
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
|
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 <89152624+StanFromIreland@users.noreply.github.com> (cherry picked from commit 37e2762)
…cape` (pythonGH-141407) (cherry picked from commit 37e2762) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
GH-141441 is a backport of this pull request to the 3.13 branch. |
…ythonGH-141407) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> (cherry picked from commit 37e2762)
…cape` (pythonGH-141407) (cherry picked from commit 37e2762) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
📚 Documentation preview 📚: https://cpython-previews--141407.org.readthedocs.build/en/141407/c-api/bytes.html#c.PyBytes_Repr