[issue11734] Add half-float (16-bit) support to struct module

Antoine Pitrou report at bugs.python.org
Wed Apr 4 17:02:42 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

Given than there is no native "half float" in C (AFAIK), does it make sense to have a native variant of half floats?
Also:

+    {'e',       sizeof(short),  SHORT_ALIGN,    nu_halffloat,   np_halffloat},

Shouldn't it be 2 rather than sizeof(short)? And why SHORT_ALIGN?

Other comments:
- in the tests, please remove the commented out print() calls
- in the tests, I don't understand why some examples are commented out; you should explain why (add a comment)
- you can add the "import math" at the top-level, rather than in the test method
- in the doc, you need a "versionchanged" or "versionadded" tag to specify that half-float support was added in 3.3

I'll let others review the numerical code, if necessary.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11734>
_______________________________________


More information about the Python-bugs-list mailing list