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

[Feature Request] Create a DivModable trait #2598

Open
1 task done
gabrieldemarmiesse opened this issue May 9, 2024 · 0 comments
Open
1 task done

[Feature Request] Create a DivModable trait #2598

gabrieldemarmiesse opened this issue May 9, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers mojo-repo Tag all issues with this label

Comments

@gabrieldemarmiesse
Copy link
Contributor

gabrieldemarmiesse commented May 9, 2024

Review Mojo's priorities

What is your request?

Create a trait for the __divmod__ method. In its simplest form, it would look like this in a struct:

fn __divmod__(self: Self, other: Self) -> Tuple[Self, Self]

What is your motivation for this change?

Each dunder method has its own trait. We should do it for __divmod__ too.

See #2097 (comment)

Any other details?

While trying to implement it, I encountered a blocking error. See the issue #2597 . It might be a compiler bug, or I might misuse traits.

@gabrieldemarmiesse gabrieldemarmiesse added enhancement New feature or request mojo-repo Tag all issues with this label labels May 9, 2024
@rparolin rparolin added the good first issue Good for newcomers label May 21, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants