Author skrah
Recipients jcon, kristjan.jonsson, mark.dickinson, ncoghlan, paul.moore, petri.lehtinen, pitrou, pv, rupole, skrah, teoliphant, vstinner
Date 2012-01-17.11:53:18
SpamBayes Score 0.0
Marked as misclassified No
Message-id <>
In-reply-to <>
Thanks for the comments. Most of them should be easy to fix.

Nick Coghlan <> wrote:
> [...] expose the Py_buffer len field as "memoryview.size" instead of
> "memoryview.len" (to reduce confusion with "len(memoryview)" and
> to encourage a conceptual link with sys.getsizeof()).

I agree with this. The best thing is probably to have both versions
work in 3.3 and remove memoryview.len in 3.4 (or later).

> As noted in the review, I also think fixing #12384 should be fairly
> straightforward and it would be nice to have that working when the
> change is applied.

tobytes() currently calls PyBuffer_ToContiguous(..., 'C') from
Objects/abstract.c. Since the function repeatedly calls
PyBuffer_GetPointer(), it has this comment:

    /* XXX : This is not going to be the fastest code in the world
             several optimizations are possible.

So if the fix for tobytes() should go in, I'd like to use the
copy_buffer() function from _testbuffer.c. PyBuffer_ToContiguous()
would need to be fixed separately. already asserts that for each result, result.tolist()
and result.tobytes() match the results obtained from PyBuffer_GetPointer(indices)
(See:, so I'm not worried about using the same
implementation in the tests as in the production code.
Date User Action Args
2012-01-17 11:53:19skrahsetrecipients: + skrah, teoliphant, paul.moore, mark.dickinson, ncoghlan, rupole, pitrou, kristjan.jonsson, vstinner, pv, jcon, petri.lehtinen
2012-01-17 11:53:19skrahlinkissue10181 messages
2012-01-17 11:53:18skrahcreate