| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Documentation build overview57 files changed · + 8 added · ± 48 modified · - 1 deleted + Added
± Modified
- Deleted |
Sorry, something went wrong.
|
The trailing NUL byte property is already documented in:
|
Sorry, something went wrong.
For consistency with the page.
|
Seems worth mentioning to me! |
Sorry, something went wrong.
|
I'd rather keep this in the function docs. Or if it needs to be here, then as a CPython implementation detail. (In another implementation, PyBytes_AsString might realloc to add the null byte.) |
Sorry, something went wrong.
Ah ok, I see you point. It sounds inefficient to me to duplicate the whole string in PyBytes_AsString() to add an extra null byte. It would be more efficient to always allocate that byte. But I take your point and I modified to note to document it as a CPython implementation detail. |
Sorry, something went wrong.
There was a problem hiding this comment.
It sounds inefficient to me to duplicate the whole string in PyBytes_AsString() to add an extra null byte.
In CPython, yes. I'm thinking about Jython-ish implementations where bytes could often reuse storage of a “native” object.
Sorry, something went wrong.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
Oh, in fact bytearray also has this trailing null byte. I update my PR to add a similar implementation detail note to bytearray. |
Sorry, something went wrong.
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
I updated the branch to retrieve a fix for the Docs CI. |
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
Sorry, something went wrong.
|
GH-157550 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
GH-157551 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
GH-157552 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…H-157236) (#157551) gh-156939: Document that PyBytesObject ends with a NUL byte (GH-157236) Document as an implementation detail that PyBytesObject and ByteArrayObject end with a NUL byte. (cherry picked from commit 2fcb0e2) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
…H-157236) (#157552) gh-156939: Document that PyBytesObject ends with a NUL byte (GH-157236) Document as an implementation detail that PyBytesObject and ByteArrayObject end with a NUL byte. (cherry picked from commit 2fcb0e2) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
Thanks for your help on that doc change @encukou. @ngoldbaum spotted that RustPython omits this trailing null bytes in its C API! RustPython/RustPython#8685 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.