Skip to content

Commit 90aa750

Browse files
committed
address review comments
1 parent 3186995 commit 90aa750

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/array_api_stubs/_draft/data_type_functions.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
def astype(
1616
x: array,
17-
dtype_or_kind: Union[dtype, str],
17+
dtype: Union[dtype, str],
1818
/,
1919
*,
2020
copy: bool = True,
@@ -45,13 +45,9 @@ def astype(
4545
----------
4646
x: array
4747
array to cast.
48-
dtype_or_kind: Union[dtype, str]
48+
dtype: Union[dtype, str]
4949
desired data type or kind of data type. Supported kinds are:
50-
- ``'bool'``: boolean data types (e.g., ``bool``).
5150
- ``'signed integer'``: signed integer data types (e.g., ``int8``, ``int16``, ``int32``, ``int64``).
52-
- ``'unsigned integer'``: unsigned integer data types (e.g., ``uint8``, ``uint16``, ``uint32``, ``uint64``).
53-
- ``'integral'``: integer data types. Shorthand for ``('signed integer', 'unsigned integer')``.
54-
- ``'real floating'``: real-valued floating-point data types (e.g., ``float32``, ``float64``).
5551
- ``'complex floating'``: complex floating-point data types (e.g., ``complex64``, ``complex128``).
5652
copy: bool
5753
specifies whether to copy an array when the specified ``dtype`` matches the data type of the input array ``x``. If ``True``, a newly allocated array must always be returned. If ``False`` and the specified ``dtype`` matches the data type of the input array, the input array must be returned; otherwise, a newly allocated array must be returned. Default: ``True``.
@@ -67,7 +63,6 @@ def astype(
6763
- Otherwise, an attempt is made to convert to the specified kind, according to the type promotion rules (see :ref:`type-promotion`).
6864
6965
- Numeric kinds are interpreted as the lowest-precision standard data type of that kind for the purposes of type promotion. For example, ``astype(x, 'complex floating')`` will return an array with the data type ``complex64`` when ``x.dtype`` is ``float32``, since ``complex64`` is the result of promoting ``float32`` with the lowest-precision standard complex data type, ``complex64``.
70-
- For kind ``integral``, the 'lowest-precision standard data type' is interpreted as ``int8``, not ``uint8``.
7166
7267
The returned array must have the same shape as ``x``.
7368

0 commit comments

Comments
 (0)