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

some fixes for ruff code C41 (about loops and iteration) #38323

Merged
merged 4 commits into from
Aug 10, 2024

Conversation

fchapoton
Copy link
Contributor

a few minor code fixes in various places, about a better use of loops

https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.

Copy link

github-actions bot commented Jul 1, 2024

Documentation preview for this PR (built with commit ceb9913; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

nontripts = [i for i in nB1 if i not in pts.keys()]
set_lps = set(lps)
curvedlines = [list(sx.difference(set_lps))
for x in M.flats(2) if (sx := set(x)) not in trilines
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this condition ever true? trilines appears to be a list of lists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the code looked strange before my changes. I am not sure what is intended by the author.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

Copy link
Contributor

@mkoeppe mkoeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@vbraun
Copy link
Member

vbraun commented Jul 24, 2024

merge conflict

Copy link
Contributor

@mkoeppe mkoeppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 5, 2024
…tion)

    
a few minor code fixes in various places, about a better use of loops

https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#38323
Reported by: Frédéric Chapoton
Reviewer(s): Frédéric Chapoton, Matthias Köppe
@vbraun vbraun merged commit 8d9da51 into sagemath:develop Aug 10, 2024
18 of 20 checks passed
@mkoeppe mkoeppe added this to the sage-10.5 milestone Aug 10, 2024
@fchapoton fchapoton deleted the fixes_on_C41 branch August 11, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants