-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
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
Changes from 3 commits
8c0f2f8
3c46609
15277b3
915b79f
58e57a4
6011132
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -228,6 +228,39 @@ called with a non-bytes parameter. | |||||||||||
| The function is :term:`soft deprecated`, | ||||||||||||
| use the :c:type:`PyBytesWriter` API instead. | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
| .. c:function:: PyObject *PyBytes_Repr(PyObject *bytes, int smartquotes) | ||||||||||||
|
|
||||||||||||
| Get the string representation of *bytes*. This function is used to | ||||||||||||
| implement :meth:`!bytes.__repr__` in Python. | ||||||||||||
|
||||||||||||
| 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.
Uh oh!
There was an error while loading. Please reload this page.