New submission from David Hewitt <da...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue46140>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to