Skip to content

Migrate sortedset - #96

Merged
OutSquareCapital merged 129 commits into
devfrom
migrate-sortedset
Sep 22, 2026
Merged

OutSquareCapital merged 129 commits into
devfrom
migrate-sortedset

Conversation

@OutSquareCapital

@OutSquareCapital OutSquareCapital commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no outstanding correctness issue or repository-rule violation was identified.

Summary

This PR migrates sorted-collection internals into reusable Rust crates and updates the PyO3 bindings, Python stubs, documentation, and regression coverage.

  • Separates empty operand lists from self-operands in sorted-set operations.
  • Preserves built-in set behavior for zero-argument and self-referential operations.
  • Adds typed regression tests for these cases.
  • Refactors shared PyO3 and standard-library utilities used by the migrated implementation.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Python["Python sorted collection API"] --> Bindings["PyO3 bindings"]
    Bindings --> Sorted["sorted_rs"]
    Sorted --> Core["Sorted collection storage and algorithms"]
    Bindings --> Ext["pyo3_ext helpers"]
    Sorted --> Tools["std_tools"]
Loading

Reviews (5) · Last reviewed commit: "fix: add `Args::Slf` to correctly handle..."

- directly bind set accessors
- make SetData generic on ListDataMethods
- added `tombi` to dev dependencies
- added it to CI workflow
- reformatted all files with it
- adjusted CONTRIBUTING.md
- aligned reprs of sorted lists with how objects are really constructed
- deleted the duplicate`L` associated types, centralizing it in
  `ListGetter`
- removed unneded duplication of `SetData` for `PyRepr` impls
unecessary (and truly unsafe) unsafe casts
already do, and who can then use this information and the sets
mathematical properties to dispatch to the least expensive operation
possible
for set operations. also allow to call these as methods directly on the
pyclass, as well as factorizing a few bounds on SortedSetMethods
Comment thread crates/sorted_rs/src/set.rs Resolved
Comment thread tests/test_sorted.py Resolved
@greptile-apps

greptile-apps Bot commented Sep 22, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@OutSquareCapital
OutSquareCapital merged commit 181300b into dev Sep 22, 2026
1 check passed
@OutSquareCapital
OutSquareCapital deleted the migrate-sortedset branch September 23, 2026 00:41
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.

1 participant