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

Change iterable interface to be more flexible #3255

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

peterebden
Copy link
Member

Rather than using length + index for everything, this leverages 1.23 iterators. It doesn't really change much fundamental yet, but does move towards being able to iterate things like dicts without extra list allocations.

Benchmarks locally actually seem to do slightly better. I'm not really sure why - I don't especially expect this to improve things dramatically as is - but the main thing is it's not getting worse.


remote_file(
name = "golangci-lint",
binary = True,
exported_files = ["golangci-lint-%s-${OS}-${ARCH}/golangci-lint" % GO_CI_LINT_VERSION],
extract = True,
hashes = [
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we really need the hashes on this, we don't actually build it into anything

}

// An indexable represents an object that knows its length and can be indexed into.
type indexable interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially missing pyObject here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really matter as such - most of the others don't have it. I'll make them consistent.

@peterebden peterebden merged commit 6a65572 into thought-machine:master Sep 24, 2024
14 checks passed
@peterebden peterebden deleted the redo-iteration branch September 24, 2024 09:05
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.

2 participants