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

Mark Dickinson dickinsm at gmail.com
Wed Mar 30 20:54:54 CEST 2011

On Wed, Mar 30, 2011 at 7:37 PM, Eli Stevens (Gmail)
<wickedgrey at gmail.com> wrote:
> What would be required to get a float16 data type added to PEP 3118
> (either implicitly via inclusion of the struct module, or explicitly
> in the PEP itself)?

Hmm.  A partial list of requirements:

(1) An open bugs.python.org issue.
(2) Someone to provide patches (it sounds like you're up for this).
(3) Someone else willing to review those patches (this is the hard part).
(4) General agreement in the b.p.o. issue that this is a worthwhile
feature to include;  a disagreement here would punt the issue back
into python-dev or python-ideas territory for wider discussion.

It probably doesn't make sense to try to update the PEP itself:  just
propose the addition to the struct module in an issue.

Work on the struct part of PEP 3118 is somewhat stalled at the moment;
 I had assigned some of those issues to myself, but unassigned them
after finding I didn't really have proper time to think about them.
If you could help out with some of the other open PEP 3118 issues,
that might go a long way towards persuading someone to review your

For myself, I have mixed feelings on the proposed addition:  while I
can see how the half-precision floats would be useful in NumPy, it's
not so clear that they'd be useful to Python itself.  It feels a
little bit odd to have NumPy driving Python additions that may not be
of that much interest to non-NumPy users.


More information about the Python-ideas mailing list