diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-11-15 01:01:36 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-11-15 01:02:40 -0800 |
commit | 5e51083b6ac3c9146d4d7f584689a9364152e638 (patch) | |
tree | 7231c2543a66453c917dd1066e8de0385e90c452 /doc | |
parent | b18d0a5aeaa4495b6589b4e9f297db7f8df35bdd (diff) | |
download | numpy-5e51083b6ac3c9146d4d7f584689a9364152e638.tar.gz |
DOC: Add release notes for ctypes improvements
Fixes gh-12272
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.16.0-notes.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/release/1.16.0-notes.rst b/doc/release/1.16.0-notes.rst index 7f2a843eb..4674c9948 100644 --- a/doc/release/1.16.0-notes.rst +++ b/doc/release/1.16.0-notes.rst @@ -311,6 +311,21 @@ This is possible thanks to the new :c:function:`PyUFunc_FromFuncAndDataAndSignatureAndIdentity`, which allows arbitrary values to be used as identities now. +Improved conversion from ctypes objects +--------------------------------------- +Numpy has always supported taking a value or type from ``ctypes`` and +converting it into an array or dtype, but only behaved correctly for simpler +types. As of this release, this caveat is lifted - now: + +* The ``_pack_`` attribute of ``ctypes.Structure``, used to emulate C's + ``__attribute__((packed))``, is respected. +* Endianness of all ctypes objects is preserved +* ``ctypes.Union`` is supported +* Unrepresentable constructs raise exceptions, rather than producing + dangerously incorrect results: + * Bitfields are no longer interpreted as sub-arrays + * Pointers are no longer replaced with the type that they point to + Changes ======= |