[Python-ideas] Adding a half-float (16-bit) type to PEP 3118 (and possibly the struct module?)

Robert Kern robert.kern at gmail.com
Wed Mar 30 23:32:32 CEST 2011

On 3/30/11 4:03 PM, Greg Ewing wrote:
> Robert Kern wrote:
>> Still, it's worth defining the standard to allow third parties to communicate
>> the full spectrum of things they want to tell each other.
> But that's impossible -- there's no way the buffer protocol
> can explicitly cover all possible data types that any third
> party application might need to deal with.
> There needs to be some common ground, and the buffer
> protocol currently defines that as the set of standard
> C data types.

And several more. I think that it would be reasonable to add more when two 
libraries come with a solid use case, like communicating the half-floats that 
are standard in OpenCL and other GPU languages.

What do you think of my idea for adding extensibility to the format syntax, 
which should allow two libraries to communicate new types without having to 
modify the PEP every time?

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the Python-ideas mailing list