diff options
Diffstat (limited to 'doc/source')
-rw-r--r-- | doc/source/reference/arrays.dtypes.rst | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/doc/source/reference/arrays.dtypes.rst b/doc/source/reference/arrays.dtypes.rst index 28e2d4f82..8f14118d6 100644 --- a/doc/source/reference/arrays.dtypes.rst +++ b/doc/source/reference/arrays.dtypes.rst @@ -424,16 +424,18 @@ Type strings ``(base_dtype, new_dtype)`` - This usage is discouraged. In NumPy 1.7 and later, it is possible - to specify struct dtypes with overlapping fields, functioning like - the 'union' type in C. The union mechanism is preferred. - - Both arguments must be convertible to data-type objects in this - case. The *base_dtype* is the data-type object that the new - data-type builds on. This is how you could assign named fields to - any built-in data-type object, as done in + In NumPy 1.7 and later, this form allows `base_dtype` to be interpreted as + a structured dtype. Arrays created with this dtype will have underlying + dtype `base_dtype` but will have fields and flags taken from `new_dtype`. + This is useful for creating custom structured dtypes, as done in :ref:`record arrays <arrays.classes.rec>`. + This form also makes it possible to specify struct dtypes with overlapping + fields, functioning like the 'union' type in C. This usage is discouraged, + however, and the union mechanism is preferred. + + Both arguments must be convertible to data-type objects with the same total + size. .. admonition:: Example 32-bit integer, whose first two bytes are interpreted as an integer |