Skip to content

Commit 26b801a

Browse files
committed
__setitem__ type promotion rules for array values
1 parent 0941b21 commit 26b801a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/array_api_stubs/_draft/array_object.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,10 @@ def __setitem__(
11341134
Indexing semantics when ``key`` is an integer array or a tuple of integers and integer arrays is currently unspecified and thus implementation-defined. This will be revisited in a future revision of this standard.
11351135
11361136
- Setting array values must not affect the data type of ``self``.
1137-
- When ``value`` is a Python scalar (i.e., ``int``, ``float``, ``complex``, ``bool``), behavior must follow specification guidance on mixing arrays with Python scalars (see :ref:`type-promotion`).
1138-
- When ``value`` is an ``array`` of a different data type than ``self``, how values are cast to the data type of ``self`` is implementation defined.
1137+
- ``value`` must be promoted to ``self.dtype`` according to :ref:`type-promotion`; if this is not possible, behavior is undefined.
1138+
1139+
.. versionchanged:: 2025.12
1140+
Specified :ref:`type-promotion` when ``value`` is an array.
11391141
"""
11401142

11411143
def __sub__(self: array, other: Union[int, float, complex, array], /) -> array:

0 commit comments

Comments
 (0)