Skip to content

Commit b65e9a5

Browse files
committed
Merge branch 'main' into 2023.12
2 parents 5cf028c + f489d51 commit b65e9a5

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.github/workflows/docs-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Download Artifact
16-
uses: dawidd6/action-download-artifact@v3
16+
uses: dawidd6/action-download-artifact@v6
1717
with:
1818
workflow: docs-build.yml
1919
name: docs-build

.github/workflows/publish-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
if: >-
9898
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
9999
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')
100-
uses: pypa/gh-action-pypi-publish@v1.8.14
100+
uses: pypa/gh-action-pypi-publish@v1.9.0
101101
with:
102102
repository-url: https://test.pypi.org/legacy/
103103
print-hash: true
@@ -110,6 +110,6 @@ jobs:
110110

111111
- name: Publish distribution 📦 to PyPI
112112
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
113-
uses: pypa/gh-action-pypi-publish@v1.8.14
113+
uses: pypa/gh-action-pypi-publish@v1.9.0
114114
with:
115115
print-hash: true

array_api_strict/_array_object.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,15 @@ def __invert__(self: Array, /) -> Array:
673673
res = self._array.__invert__()
674674
return self.__class__._new(res)
675675

676+
def __iter__(self: Array, /):
677+
"""
678+
Performs the operation __iter__.
679+
"""
680+
# Manually disable iteration, since __getitem__ raises IndexError on
681+
# things like ones((3, 3))[0], which causes list(ones((3, 3))) to give
682+
# [].
683+
raise TypeError("array iteration is not allowed in array-api-strict")
684+
676685
def __le__(self: Array, other: Union[int, float, Array], /) -> Array:
677686
"""
678687
Performs the operation __le__.

array_api_strict/tests/test_array_object.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ def test_array_namespace():
423423
pytest.raises(ValueError, lambda: a.__array_namespace__(api_version="2021.11"))
424424
pytest.raises(ValueError, lambda: a.__array_namespace__(api_version="2024.12"))
425425

426+
def test_no_iter():
427+
pytest.raises(TypeError, lambda: iter(ones(3)))
428+
pytest.raises(TypeError, lambda: iter(ones((3, 3))))
426429

427430
@pytest.mark.parametrize("api_version", ['2021.12', '2022.12', '2023.12'])
428431
def dlpack_2023_12(api_version):

0 commit comments

Comments
 (0)