[Feature Request] Add a sorted(iterable) builtin
Nobody has claimed this yet.
- Dominant language
- Mojo
- Stars
- 29.8k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Review Mojo's priorities
- I have read the roadmap and priorities and I believe this request falls within the priorities.
What is your request?
Python has this, so I think mojo should have this too. This is mostly a convinience function, but relatively common from my rust experience.
Performance
We could either add overloads for owned Lists, which turn this into a sort or we could use type and trait reflection to avoid unnecessary copying.
Note: #2390 already exists. But this proposal is more precise and #2930 seems to be stale.
What is your motivation for this change?
N/A
Any other details?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing sort functionality and the related issues #2390 and #2930. Define the sorted(iterable) behavior against Python's sorted builtin, then determine whether the implementation should use owned List overloads or type and trait reflection; done means the builtin works without unnecessary copying.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100