Skip to content

Commit

Permalink
DOC: Add release notes for ctypes improvements
Browse files Browse the repository at this point in the history
eric-wieser committed Nov 15, 2018
1 parent b18d0a5 commit 5e51083
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/release/1.16.0-notes.rst
Original file line number Diff line number Diff line change
@@ -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
=======

0 comments on commit 5e51083

Please sign in to comment.