Greg Ewing wrote:
> 
> The buffer API is for the use of C code, and it should
> be designed with the convenience of C code in mind.
> Using Python data structures unnecessarily seems like
> the wrong way to go about that.
> 
> The following alternative would seem to provide most of
> the things that Travis's proposal does without involving
> Python objects:
> 


In my latest version of the PEP, I suggest using Python CObject's as 
loose wrappers around C-structures for both the char * format string and 
the structure

int ndim
Py_ssize_t *shape;
Py_ssize_t *strides;

This way, we get the benefit of Python object counting for memory 
management but easy-access to the relevant C-objects.

I've also added simple functions to the proposed C-API to construct 
these C-objects.

-Travis

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to