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

refactor set_ids() to use enumerate and/or list comprehension #1

Open
dimitrilw opened this issue Apr 30, 2024 · 1 comment
Open

refactor set_ids() to use enumerate and/or list comprehension #1

dimitrilw opened this issue Apr 30, 2024 · 1 comment
Labels
blocked Issue is blocked by externality good first issue Good for newcomers

Comments

@dimitrilw
Copy link
Owner

dimitrilw commented Apr 30, 2024

When able, change DisjointSet.Set_ids() to use enumerate and/or list comprehension.

enumerate():

...
for i, p in enumerate(self.parents):
     if i == p:
        ...

list comprehension:

return List[Int](i for i, p in enumerate(self.parents) if i == p)
@dimitrilw dimitrilw added the good first issue Good for newcomers label Apr 30, 2024
@dimitrilw
Copy link
Owner Author

Of note: we can't do this yet. I am going to add a "blocked" tag. This task is blocked, awaiting more features in core Mojo language.

@dimitrilw dimitrilw added the blocked Issue is blocked by externality label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Issue is blocked by externality good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant