Re: [Python-3000] Using memoryviews

2008-11-27 Thread Stefan Behnel
M.-A. Lemburg wrote: > I find the implementation of the buffer protocol way too complicated. > One of the reasons why the buffer protocol in Python 2 never caught > on was the fact that it was too complicated and the Python 3 is > even worse in this respect. > > In practice you do want to have the

Re: [Python-3000] Using memoryviews

2008-11-25 Thread M.-A. Lemburg
On 2008-11-22 00:52, Benjamin Peterson wrote: > On Fri, Nov 21, 2008 at 5:34 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> Benjamin Peterson wrote: >>> On Fri, Nov 21, 2008 at 1:41 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: In the past, we've always tried to provide abstract access methods

Re: [Python-3000] Using memoryviews

2008-11-23 Thread Nick Coghlan
Josiah Carlson wrote: > On Sat, Nov 22, 2008 at 4:18 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: >> The big, big limitation of memoryviews right now is that they only support >> one-dimensional byte buffers. The people interested in more complex >> arrangements >> (that is, Scipy/Numpy people) h

Re: [Python-3000] Using memoryviews

2008-11-23 Thread Georg Brandl
Josiah Carlson schrieb: > On Sat, Nov 22, 2008 at 4:18 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: >> Josiah Carlson gmail.com> writes: >>> >>> From what I understand of the memoryview when I tried to do the same >>> thing a few months ago (use memoryview to replace buffer in >>> asyncore/asynch

Re: [Python-3000] Using memoryviews

2008-11-23 Thread Josiah Carlson
On Sat, Nov 22, 2008 at 4:18 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: > Josiah Carlson gmail.com> writes: >> >> From what I understand of the memoryview when I tried to do the same >> thing a few months ago (use memoryview to replace buffer in >> asyncore/asynchat), memoryview is incomplete.

Re: [Python-3000] Using memoryviews

2008-11-22 Thread Antoine Pitrou
Josiah Carlson gmail.com> writes: > > From what I understand of the memoryview when I tried to do the same > thing a few months ago (use memoryview to replace buffer in > asyncore/asynchat), memoryview is incomplete. It didn't support > character buffer slicing (you know, the 'offset' and 'size'

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Benjamin Peterson
On Fri, Nov 21, 2008 at 5:34 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Benjamin Peterson wrote: >> On Fri, Nov 21, 2008 at 1:41 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >>> In the past, we've always tried to provide abstract access methods to >>> C struct internals of Python objects and I w

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Nick Coghlan
Benjamin Peterson wrote: > On Fri, Nov 21, 2008 at 1:41 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> In the past, we've always tried to provide abstract access methods to >> C struct internals of Python objects and I wonder whether this was >> deliberately not done for Py_buffer structs or simpl

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Benjamin Peterson
On Fri, Nov 21, 2008 at 1:41 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > > In the past, we've always tried to provide abstract access methods to > C struct internals of Python objects and I wonder whether this was > deliberately not done for Py_buffer structs or simply not considered. > > I don'

Re: [Python-3000] Using memoryviews

2008-11-21 Thread M.-A. Lemburg
On 2008-11-21 17:30, Josiah Carlson wrote: > On Thu, Nov 20, 2008 at 2:12 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: >> I've had a look at the new memoryview and associated buffer API >> and have a question: how is a C extension supposed to use the buffer >> API without going directly into the C

Re: [Python-3000] Using memoryviews

2008-11-21 Thread Josiah Carlson
On Thu, Nov 20, 2008 at 2:12 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > I've had a look at the new memoryview and associated buffer API > and have a question: how is a C extension supposed to use the buffer > API without going directly into the C struct Py_buffer ? > > I have not found any macr

[Python-3000] Using memoryviews

2008-11-20 Thread M.-A. Lemburg
I've had a look at the new memoryview and associated buffer API and have a question: how is a C extension supposed to use the buffer API without going directly into the C struct Py_buffer ? I have not found any macros for accessing Py_buffer internals and the docs mention the struct members direct