-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-53243: Document codecs.readbuffer_encode()
#136284
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
base: main
Are you sure you want to change the base?
Conversation
PS. Marc, you should add yourself as CODEOWNER of the |
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, but please also see my comments.
Doc/library/codecs.rst
Outdated
|
||
Return a :class:`tuple` containing the raw bytes of *buffer*, a | ||
:ref:`buffer-compatible object <bufferobjects>` or :class:`str`, and their | ||
length. |
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.
Shouldn't this read "and its length in bytes" ?
For str
objects, the AC (argument clinic) converts the object to a UTF-8 bytes object first and then treats uses the bytes
object's buffer interface to read this.
Not sure whether this is relevant, but perhaps worth a mention, since this happens for all functions/methods which use Py_buffer arguments which accept str
.
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.
@StanFromIreland Did you see my 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.
Your comment just appeared now, so I presume you left it in the "pending" state (I've done this before!). I will fix it tomorrow.
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.
Could be (I really don't like or fully understand the Github UI). Thanks.
📚 Documentation preview 📚: https://cpython-previews--136284.org.readthedocs.build/en/136284/library/codecs.html#codecs.readbuffer_encode