summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-11-15 01:01:36 -0800
committerEric Wieser <wieser.eric@gmail.com>2018-11-15 01:02:40 -0800
commit5e51083b6ac3c9146d4d7f584689a9364152e638 (patch)
tree7231c2543a66453c917dd1066e8de0385e90c452
parentb18d0a5aeaa4495b6589b4e9f297db7f8df35bdd (diff)
downloadnumpy-5e51083b6ac3c9146d4d7f584689a9364152e638.tar.gz
DOC: Add release notes for ctypes improvements
Fixes gh-12272
-rw-r--r--doc/release/1.16.0-notes.rst15
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
=======