summaryrefslogtreecommitdiff
path: root/doc/release
diff options
context:
space:
mode:
authorAntony Lee <anntzer.lee@gmail.com>2019-04-14 15:12:33 +0200
committerAntony Lee <anntzer.lee@gmail.com>2019-05-24 23:46:51 +0200
commitad1e0600e45b9fa71096d0a0f10c1474e003f373 (patch)
tree5c8efa002277c40280ff886e3d990060c4ad9d48 /doc/release
parent9713e86cc65ebed96464f4d81bb2637857b84f44 (diff)
downloadnumpy-ad1e0600e45b9fa71096d0a0f10c1474e003f373.tar.gz
Deprecate collapsing shape-1 dtype fields to scalars.
Currently, a field specified as `[(name, dtype, 1)]` is interpreted as a scalar field (i.e., the same as `[(name, dtype)]` or `[(name, dtype, ()]`). This now raises a FutureWarning; in a future version, it will be interpreted as a shape-(1,) field, i.e. the same as `[(name, dtype, (1,))]` (consistently with `[(name, dtype, n)]` with `n>1`, which is already equivalent to `[(name, dtype, (n,)]`).
Diffstat (limited to 'doc/release')
-rw-r--r--doc/release/1.17.0-notes.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/release/1.17.0-notes.rst b/doc/release/1.17.0-notes.rst
index 5a27b8046..3194867f9 100644
--- a/doc/release/1.17.0-notes.rst
+++ b/doc/release/1.17.0-notes.rst
@@ -47,6 +47,16 @@ a manner are very rare in practice and only available through the NumPy C-API.
Future Changes
==============
+Shape-1 fields in dtypes won't be collapsed to scalars in a future version
+--------------------------------------------------------------------------
+
+Currently, a field specified as ``[(name, dtype, 1)]`` or ``"1type"`` is
+interpreted as a scalar field (i.e., the same as ``[(name, dtype)]`` or
+``[(name, dtype, ()]``). This now raises a FutureWarning; in a future version,
+it will be interpreted as a shape-(1,) field, i.e. the same as ``[(name,
+dtype, (1,))]`` or ``"(1,)type"`` (consistently with ``[(name, dtype, n)]``
+/ ``"ntype"`` with ``n>1``, which is already equivalent to ``[(name, dtype,
+(n,)]`` / ``"(n,)type"``).
Expired deprecations
====================