[Python-3000] Py3k-buffer branch merged back to py3k branch

Lisandro Dalcin dalcinl at gmail.com
Tue Aug 21 17:00:36 CEST 2007


Travis, I had no much time to follow you on py3k-buffer branch, but
now you merged in py3k, I want to make an small comment for your
consideration.

Pehaps the 'PyBuffer' struct could be named different, something like
'Py_buffer'. The use case has some similarites to 'Py_complex' struct.
It is no related to any 'PyObject*', but to a public structure wich,
(if I understand right) can be declared and used in static storage.

In short, I am propossing the naming below. Note I removed
'bufferinfo' in the typedef line, as it seems to be not needed and it
only appears here after grepping in sources) and could conflict with
user code.

/* buffer interface */
typedef struct {
    .....
} Py_buffer;

typedef struct {
        PyObject_HEAD
        PyObject *base;
        Py_buffer view;
} PyMemoryViewObject;


Again, taking complex as an example, please note the symmetry:


typedef struct {
    double real;
    double imag;
} Py_complex;

typedef struct {
    PyObject_HEAD
    Py_complex cval;
} PyComplexObject;


Regards,


On 8/18/07, Travis E. Oliphant <oliphant.travis at ieee.org> wrote:
> In preparation for the sprints, I have converted all Python objects to
> use the new buffer protocol PEP and implemented most of the C-API.  This
> work took place in the py3k-buffer branch which now passes all the tests
> that py3k does.
>
> So, I merged the changes back to the py3k branch in hopes that others
> can continue working on what I've done.  The merge took place after
> fully syncing the py3k-buffer branch with the current trunk.

-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594


More information about the Python-3000 mailing list