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

2015-04-02 Thread Stefan Krah
Changes by Stefan Krah ste...@bytereef.org: -- assignee: - skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23376 ___ ___ Python-bugs-list

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

2015-04-01 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23376 ___ ___ Python-bugs-list

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

2015-02-04 Thread Serhiy Storchaka
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 ___

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

2015-02-02 Thread Stefan Krah
Stefan Krah added the comment: Ah yes, it seems to originate from #3139. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23376 ___ ___

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

2015-02-02 Thread Stefan Krah
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

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

2015-02-02 Thread STINNER Victor
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. -- ___

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

2015-02-02 Thread STINNER Victor
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

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

2015-02-02 Thread Stefan Krah
Stefan Krah added the comment: Yes, _testbuffer.ndarray can create any buffer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23376 ___ ___

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

2015-02-02 Thread STINNER Victor
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#. --

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

2015-02-02 Thread Stefan Krah
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

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

2015-02-02 Thread Stefan Krah
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

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

2015-02-02 Thread Serhiy Storchaka
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

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

2015-02-02 Thread STINNER Victor
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

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

2015-02-02 Thread Stefan Krah
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

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

2015-02-02 Thread Stefan Krah
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