data-apis / array-api-strict

Strict implementation of the Python array API (previously numpy.array_api)
http://data-apis.org/array-api-strict/
Other
7 stars 4 forks source link

Disable array iteration #42

Closed asmeurer closed 3 months ago

asmeurer commented 3 months ago

Fixes #41.

asmeurer commented 2 months ago

I do wonder if this isn't too strict. Python itself implements __iter__ using __getitem__, so technically __iter__ should work in the base array API for 1-D arrays.

OTOH, there were explicit discussions about array iteration being ambiguous, especially for higher dimensional arrays, so disallowing it is at least within the spirit of the array API.