Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-38457: Add an __iter__ to Point and Extent #42

Merged
merged 1 commit into from Mar 29, 2023
Merged

Conversation

timj
Copy link
Member

@timj timj commented Mar 28, 2023

The default implementation for iter is to use getitem repeatedly until IndexError is raissed. This is incredibly expensive on macOS with Apple silicon and is unnecessary because Point and Extent have a predefined number of elements. This change uses the .dimensions property to limit the iterator.

The default implementation for __iter__ is to use __getitem__
repeatedly until IndexError is raissed. This is incredibly expensive
on macOS with Apple silicon and is unnecessary because Point and
Extent have a predefined number of elements. This change uses
the .dimensions property to limit the iterator.
@timj timj merged commit 3f8e190 into main Mar 29, 2023
1 check passed
@timj timj deleted the tickets/DM-38457 branch March 29, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants