Changes by Stefan Krah ste...@bytereef.org:
--
assignee: - skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23376
___
___
Python-bugs-list
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23376
___
___
Python-bugs-list
Serhiy Storchaka added the comment:
See also contiguity tests in Modules/binascii.c and Modules/_ssl.c,
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23376
___
Stefan Krah added the comment:
Ah yes, it seems to originate from #3139.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23376
___
___
Stefan Krah added the comment:
Well, here's a patch with tests.
Victor, I think you added the contiguity test in 9d49b744078c. Do you
remember why?
--
Added file: http://bugs.python.org/file37987/issue23376-2.diff
___
Python tracker
STINNER Victor added the comment:
Victor, I think you added the contiguity test in 9d49b744078c. Do you
remember why?
I don't understand the change like that. The call to
PyBuffer_IsContiguous(view, 'C') was older than this changeset.
--
___
STINNER Victor added the comment:
Do you have unit test with non contiguous buffers? If not, it would help to
have such buffer in _testcapi.
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23376
Stefan Krah added the comment:
Yes, _testbuffer.ndarray can create any buffer.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23376
___
___
STINNER Victor added the comment:
Yes, _testbuffer.ndarray can create any buffer.
Cool. So could you please add non regression tests to test_w_star() of
test_getargs2?
Other formats expect a contiguous buffer: 'y*', 's*', 'z*'.
Formats which convert a buffer: 'y', 's#', 'z#.
--
Stefan Krah added the comment:
A unit test would not be so helpful. The potential problem is that
third party extensions with broken getbufferprocs would suffer.
But at some point we have to streamline PEP-3118 code, or it
will remain inscrutable forever. Extension writers often copy
code
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
Serhiy Storchaka added the comment:
I think memoryview(bytearray)[::2] provides non contiguous buffers. But I'm not
sure this is tested.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23376
STINNER Victor added the comment:
A unit test would not be so helpful. The potential problem is that
third party extensions with broken getbufferprocs would suffer.
I don't understand the link between third party extensions and
test_getargs2. test_getargs2 is a unit test for non-regression of
Changes by Stefan Krah ste...@bytereef.org:
--
nosy: skrah
priority: normal
severity: normal
status: open
title: getargs.c: redundant C-contiguity check
type: performance
versions: Python 3.5
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
STINNER Victor wrote:
I don't understand the link between third party extensions and
test_getargs2. test_getargs2 is a unit test for non-regression of
CPython. Can you please elaborate?
A test failure needs a broken buffer provider that hands out a
15 matches
Mail list logo