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

ext: add list.sort() #1021

Merged
merged 6 commits into from
Sep 23, 2024
Merged

Conversation

cezar-guimaraes
Copy link
Contributor

I skipped creating an issue because this seemed like a small enough change to me, but please let me know if an issue is preferable.

This PR adds a <list(T)>.sort() -> <list(T)> member. T must implement (traits.Comparer).

I believe that the check if the element type implements traits.Comparer only happens at runtime (how can I write tests for this?). An alternative implementation would create separate member overloads for list(T), T in {set of comparable types} similar to kube apiserver list extensions

Let me know if I should update the PR to create separate overloads.

Copy link

google-cla bot commented Sep 12, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@TristonianJones
Copy link
Collaborator

/gcbrun

ext/lists.go Outdated Show resolved Hide resolved
@TristonianJones
Copy link
Collaborator

/gcbrun

ext/lists.go Outdated Show resolved Hide resolved
@TristonianJones
Copy link
Collaborator

@cezar-guimaraes I just had one more comment, but otherwise this is looking good.

@TristonianJones
Copy link
Collaborator

/gcbrun

@cezar-guimaraes
Copy link
Contributor Author

Rebased the branch to use the new helper type introduced in #1026
1ad695c

@TristonianJones
Copy link
Collaborator

/gcbrun

@TristonianJones TristonianJones merged commit 45bd6f6 into google:master Sep 23, 2024
2 checks passed
@TristonianJones
Copy link
Collaborator

@cezar-guimaraes thanks for your contribution and your patience!

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