This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Some API methods could take const Py_buffer* instead of Py_buffer *
Type: Stage: resolved
Components: Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: davidhewitt, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2021-12-20 22:26 by davidhewitt, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30217 merged davidhewitt, 2021-12-20 22:34
Messages (3)
msg408976 - (view) Author: David Hewitt (davidhewitt) * Date: 2021-12-20 22:26
The limited api methods `PyBuffer_GetPointer`, `PyBuffer_FromContiguous`, `PyBuffer_ToContiguous` and `PyMemoryView_FromBuffer` take buffer arguments as `Py_buffer *`.

They do not mutate the buffer info, so could simply take `const Py_buffer *`.

There is already precedent to take `const Py_buffer *` argument in `PyBuffer_IsContiguous`.

I'm going to submit a PR to fix.
msg409032 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-22 13:08
New changeset 31ff96712e8f89ac1056c2da880b44650002219f by David Hewitt in branch 'main':
bpo-46140: take more Py_buffer arguments as const * (GH-30217)
https://github.com/python/cpython/commit/31ff96712e8f89ac1056c2da880b44650002219f
msg409033 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-22 13:08
Thank you for your contribution David.
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90298
2021-12-22 13:08:49serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg409033

stage: patch review -> resolved
2021-12-22 13:08:02serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg409032
2021-12-20 22:34:57davidhewittsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28438
2021-12-20 22:26:56davidhewittcreate