[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

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-20 Thread M.-A. Lemburg
On 2008-11-14 22:15, Roger Binns wrote: > My confusion was because I though that the HEAD for the data structure > had to use the same corresponding HEAD_INIT in the type. So for > whatever reason the PyTypeObject is declared as a var object which is > why the var HEAD_INIT is needed. > > It stil

Re: [Python-3000] PyObject_HEAD_INIT

2008-11-20 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 M.-A. Lemburg wrote: > Whether you write: > > {PyObject_HEAD_INIT(0), 0, ... > > or > > {PyVarObject_HEAD_INIT(0, 0), ... > > for your type definition doesn't really make much difference. Actually in Py 3 it does. If you use the former (which is