Initial patch; tests pass. A couple notes:
- I manually excised some commented changes to structmodule.{h,c} from the .patch; once I get a determination on if those files need to be updated or not I will discard the changes or implement what needs to be done there. Hopefully I didn't damage the patch while editing.
- The code in _PyFloat_Pack2 and _PyFloat_Unpack2 is adapted from the numpy code in https://github.com/numpy/numpy/blob/master/numpy/core/src/npymath/halffloat.c . This means that it is BSD licensed; I'm presuming that is acceptable for inclusion in CPython. If not, I'll try a clean-room implementation. |