[Numpy-discussion] [Fwd: python-dev Summary for 2006-11-01 through 2006-11-15] - further discussion on buffer description

Colin J. Williams cjw at sympatico.ca
Tue Nov 28 08:47:30 CST 2006

-------- Original Message --------
Subject: python-dev Summary for 2006-11-01 through 2006-11-15
Date: Mon, 27 Nov 2006 04:52:10 +0000 (GMT)
From: steven.bethard at gmail.com
Newsgroups: gmane.comp.python.general

python-dev Summary for 2006-11-01 through 2006-11-15

.. excerpt::

[The HTML version of this Summary is available at

The buffer protocol and communicating binary format information

The discussion of extending the buffer protocol to more binary formats 
continued this fortnight. Though the PIL_ had been used as an example of 
a library that could benefit from an extended buffer protocol, Fredrik 
Lundh indicated that future versions of the PIL_ would make the binary 
data model completely opaque, and instead provide a view-style API like::

     view = object.acquire_view(region, supported formats)
     ... access data in view ...

Along these lines, the discussion turned away from the particular C 
formats used in ``ctypes``, ``numpy``, ``array``, etc. and more towards 
the best way to communicate format information between these modules. 
Though it seemed like people were not completely happy with the proposed 
API of the new buffer protocol, the discussion seemed to skirt around 
any concrete suggestions for better APIs.

In the end, the only thing that seemed certain was that a new buffer 
protocol could only be successful if it were implemented on all of the 
appropriate stdlib modules: ``ctypes``, ``array``, ``struct``, etc.

.. _PIL: http://www.pythonware.com/products/pil/

Contributing threads:

- `PEP: Adding data-type objects to Python 
- `PEP: Extending the buffer protocol to share array information. 
- `idea for data-type (data-format) PEP 

More information about the Numpy-discussion mailing list