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

Remove redundant parentheses in case statement if guards #4214

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

dosisod
Copy link
Contributor

@dosisod dosisod commented Feb 6, 2024

Description

A follow up to #4024 but for if guards in case statements. I noticed this when #4024 was made stable, and noticed I had some code that had extra parens around the if guard.

There might be some edge cases I am not thinking of, but all tests are passing. I put these new changes under the remove_redundant_guard_parens preview name.

Checklist

  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

A follow up to psf#4024 but for `if` guards in `case` statements. I noticed this
when psf#4024 was made stable, and noticed I had some code that had extra parens
around the `if` guard.

There might be some edge cases I am not thinking of, but all tests are passing.
I put these new changes under the `remove_redundant_guard_parens` preview name.
Copy link

github-actions bot commented Feb 6, 2024

diff-shades reports zero changes comparing this PR (d8c482b) to main (32230e6).


What is this? | Workflow run | diff-shades documentation


match 1:
case _ if (
True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add tests with a comment inside the parentheses in various places

Copy link
Collaborator

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

2 participants