[issue46140] Some API methods could take const Py_buffer* instead of Py_buffer *

David Hewitt report at bugs.python.org
Mon Dec 20 17:26:56 EST 2021


New submission from David Hewitt <david at hewitt.tech>:

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.

----------
messages: 408976
nosy: davidhewitt
priority: normal
severity: normal
status: open
title: Some API methods could take const Py_buffer* instead of Py_buffer *
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46140>
_______________________________________


More information about the Python-bugs-list mailing list