X Tutup
The Wayback Machine - https://web.archive.org/web/20221223141351/https://github.com/python/cpython/pull/98133
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

[3.11] Fix types in buffer/memoryview docs (GH-98118) #98133

Merged
merged 1 commit into from Oct 10, 2022

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 10, 2022

The definition of obj in the Py_buffer struct is as a PyObject*
https://github.com/python/cpython/blob/ec091bd47e2f968b0d1631b9a8104283a7beeb1b/Include/pybuffer.hGH-L22

PyMemoryView_GET_BASE returns .obj - thus its return type
should be a PyObject* (or at least a void*). It definitely
doesn't return Py_buffer
(cherry picked from commit c459fed)

Co-authored-by: da-woods dw-git@d-woods.co.uk

The definition of obj in the `Py_buffer` struct is as a PyObject*
https://github.com/python/cpython/blob/ec091bd47e2f968b0d1631b9a8104283a7beeb1b/Include/pybuffer.hGH-L22

PyMemoryView_GET_BASE returns `.obj` - thus its return type
should be a PyObject* (or at least a void*). It definitely
doesn't return `Py_buffer`
(cherry picked from commit c459fed)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
@miss-islington miss-islington merged commit 4172e09 into python:3.11 Oct 10, 2022
15 checks passed
@miss-islington miss-islington deleted the backport-c459fed-3.11 branch Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants
X Tutup