On 2/27/07, Travis Oliphant <[EMAIL PROTECTED]> wrote:

PEP: <unassigned>
Title: Revising the buffer protocol
Version: $Revision: $
Last-Modified: $Date:  $
Author: Travis Oliphant <[EMAIL PROTECTED]>
Status: Draft
Type: Standards Track
Created: 28-Aug-2006
Python-Version: 3000


<snip>


Additions to the struct string-syntax

   The struct string-syntax is missing some characters to fully
   implement data-format descriptions already available elsewhere (in
   ctypes and NumPy for example).  Here are the proposed additions:

   Character         Description
   ==================================
   '1'               bit (number before states how many bits)
   '?'               platform _Bool type
   'g'               long double
   'F'               complex float
   'D'               complex double
   'G'               complex long double
   'c'               ucs-1 (latin-1) encoding
   'u'               ucs-2
   'w'               ucs-4
   'O'               pointer to Python Object
   'T{}'             structure (detailed layout inside {})
   '(k1,k2,...,kn)'  multi-dimensional array of whatever follows
   ':name:'          optional name of the preceeding element
   '&'               specific pointer (prefix before another charater)
   'X{}'             pointer to a function (optional function
                                             signature inside {})


I think it might be good to have something for the quad and half precision
floats that will be coming along in the next IEEE754  specification. Quad
precision isn't used that much, but when you need it, it is useful. Half
precision (16 bits) is used in some GPU's and I have seen it used for such
things as recording side looking radar returns.

Chuck
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to