Skip to content

breaking lines after else: in pyx files #39393

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

Merged
merged 4 commits into from
Feb 10, 2025

Conversation

fchapoton
Copy link
Contributor

as this is already done in all .py files and almost all pyx files

📝 Checklist

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

Copy link

github-actions bot commented Jan 27, 2025

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

@kwankyu
Copy link
Collaborator

kwankyu commented Feb 4, 2025

You make changes preferring (A)

if some condition:
    return this
do that

over (B)

if some condition:
    return this
else:
    do that

I agree, but some authors prefer (B) in some cases. Does our linter check against (B)?

@fchapoton
Copy link
Contributor Author

thanks for the review. I have made the suggested change and fix. Concerning the removal of else, there is indeed no check in the linter for that. And in principle I would say that both are ok. Sometimes I remove the else because the code becomes shorter, but not systematically.

Copy link
Collaborator

@kwankyu kwankyu 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 Feb 9, 2025
sagemathgh-39393: breaking lines after else: in pyx files
    
as this is already done in all .py files and almost all pyx files

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#39393
Reported by: Frédéric Chapoton
Reviewer(s): David Coudert, Kwankyu Lee
vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 9, 2025
sagemathgh-39393: breaking lines after else: in pyx files
    
as this is already done in all .py files and almost all pyx files

### 📝 Checklist

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
    
URL: sagemath#39393
Reported by: Frédéric Chapoton
Reviewer(s): David Coudert, Kwankyu Lee
@vbraun vbraun merged commit 673f9a0 into sagemath:develop Feb 10, 2025
22 of 23 checks passed
@fchapoton fchapoton deleted the break_after_else branch February 11, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants