Skip to content

Commit 7117f2c

Browse files
committed
feat!: return tuples rather than lists
1 parent 18315b9 commit 7117f2c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/array_api_stubs/_draft/creation_functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def linspace(
451451
"""
452452

453453

454-
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array]:
454+
def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> Tuple[array, ...]:
455455
"""
456456
Returns coordinate matrices from coordinate vectors.
457457
@@ -464,8 +464,8 @@ def meshgrid(*arrays: array, indexing: Literal["xy", "ij"] = "xy") -> List[array
464464
465465
Returns
466466
-------
467-
out: List[array]
468-
list of N arrays, where ``N`` is the number of provided one-dimensional input arrays. Each returned array must have rank ``N``. For ``N`` one-dimensional arrays having lengths ``Ni = len(xi)``,
467+
out: Tuple[array, ...]
468+
tuple of N arrays, where ``N`` is the number of provided one-dimensional input arrays. Each returned array must have rank ``N``. For ``N`` one-dimensional arrays having lengths ``Ni = len(xi)``,
469469
470470
- if matrix indexing ``ij``, then each returned array must have the shape ``(N1, N2, N3, ..., Nn)``.
471471
- if Cartesian indexing ``xy``, then each returned array must have shape ``(N2, N1, N3, ..., Nn)``.

src/array_api_stubs/_draft/info.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,19 @@ def dtypes(
172172
"""
173173

174174

175-
def devices() -> List[device]:
175+
def devices() -> Tuple[device, ...]:
176176
"""
177177
Returns a list of supported devices which are available at runtime.
178178
179179
Returns
180180
-------
181-
out: List[device]
182-
a list of supported devices.
181+
out: Tuple[device, ...]
182+
tuple containing a list of supported devices.
183183
184184
Notes
185185
-----
186186
187-
- Each device object (see :ref:`device-support`) in the list of returned devices **must** be an object which can be provided as a valid keyword-argument to array creation functions.
187+
- Each device object (see :ref:`device-support`) in the tuple of returned devices **must** be an object which can be provided as a valid keyword-argument to array creation functions.
188188
189189
Notes
190190
-----

src/array_api_stubs/_draft/manipulation_functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from ._types import List, Optional, Tuple, Union, array
2020

2121

22-
def broadcast_arrays(*arrays: array) -> List[array]:
22+
def broadcast_arrays(*arrays: array) -> Tuple[array, ...]:
2323
"""
2424
Broadcasts one or more arrays against one another.
2525
@@ -30,8 +30,8 @@ def broadcast_arrays(*arrays: array) -> List[array]:
3030
3131
Returns
3232
-------
33-
out: List[array]
34-
a list of broadcasted arrays. Each array **must** have the same shape. Each array **must** have the same dtype as its corresponding input array.
33+
out: Tuple[array, ...]
34+
tuple of broadcasted arrays. Each array **must** have the same shape. Each array **must** have the same dtype as its corresponding input array.
3535
"""
3636

3737

0 commit comments

Comments
 (0)