[issue23376] getargs.c: redundant C-contiguity check

Stefan Krah report at bugs.python.org
Mon Feb 2 13:17:17 CET 2015


New submission from Stefan Krah:

The call to PyBuffer_IsContiguous() (see patch) is redundant:

PyBUF_WRITABLE is a flag that can be added to any buffer request.
The real request here is (PyBUF_SIMPLE|PyBUF_WRITABLE), which is
equal to PyBUF_WRITABLE since PyBUF_SIMPLE==0.

PyBUF_SIMPLE implies C-contiguous with format 'B'.


Perhaps the check was added for broken buffer providers, but I
think at some point we should assume correct providers.

----------
keywords: +patch
nosy: +larry
Added file: http://bugs.python.org/file37976/issue23376.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23376>
_______________________________________


More information about the Python-bugs-list mailing list