Visitar URL original
bpo-46140: take more Py_buffer arguments as const * by davidhewitt · Pull Request #30217 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20221223141515/https://github.com/python/cpython/pull/30217
Skip to content
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

bpo-46140: take more Py_buffer arguments as const * #30217

Merged
merged 4 commits into from Dec 22, 2021

Conversation

davidhewitt
Copy link
Contributor

@davidhewitt davidhewitt commented Dec 20, 2021 •

Changes PyBuffer_GetPointer, PyBuffer_FromContiguous, PyBuffer_ToContiguous and PyMemoryView_FromBuffer to take buffer info by const Py_buffer * instead of Py_buffer *, as they do not need mutability.

PyBuffer_FromContiguous also now takes the source buffer as const void *, and similarly PyBuffer_GetPointer takes the strides as const Py_ssize_t *.

Finally, corrects the documentation for PyBuffer_IsContiguous, which already took const Py_buffer * (but was documented as Py_buffer *).

https://bugs.python.org/issue46140

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

LGTM. Please add a NEWS entry.

@davidhewitt
Copy link
Contributor Author

davidhewitt commented Dec 21, 2021

Thanks - news entry added!

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

👍

@serhiy-storchaka serhiy-storchaka merged commit 31ff967 into python:main Dec 22, 2021
12 checks passed
@davidhewitt davidhewitt deleted the const-buffer branch Dec 22, 2021
brandtbucher pushed a commit to brandtbucher/cpython that referenced this pull request Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants