mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46906: Add PyFloat_Pack8() to the C API (GH-31657)
Add new functions to pack and unpack C double (serialize and deserialize): * PyFloat_Pack2(), PyFloat_Pack4(), PyFloat_Pack8() * PyFloat_Unpack2(), PyFloat_Unpack4(), PyFloat_Unpack8() Document these functions and add unit tests. Rename private functions and move them from the internal C API to the public C API: * _PyFloat_Pack2() => PyFloat_Pack2() * _PyFloat_Pack4() => PyFloat_Pack4() * _PyFloat_Pack8() => PyFloat_Pack8() * _PyFloat_Unpack2() => PyFloat_Unpack2() * _PyFloat_Unpack4() => PyFloat_Unpack4() * _PyFloat_Unpack8() => PyFloat_Unpack8() Replace the "unsigned char*" type with "char*" which is more common and easy to use.
This commit is contained in:
parent
ecfff63e06
commit
882d8096c2
13 changed files with 294 additions and 91 deletions
|
@ -766,6 +766,12 @@ New Features
|
|||
available directly (via :c:type:`PyCMethod`).
|
||||
(Contributed by Petr Viktorin in :issue:`46613`.)
|
||||
|
||||
* Add new functions to pack and unpack C double (serialize and deserialize):
|
||||
:c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`,
|
||||
:c:func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` and
|
||||
:c:func:`PyFloat_Unpack8`.
|
||||
(Contributed by Victor Stinner in :issue:`46906`.)
|
||||
|
||||
|
||||
Porting to Python 3.11
|
||||
----------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue