Skip to content

Commit

Permalink
Make star-expression spacing consistent in match/case
Browse files Browse the repository at this point in the history
  • Loading branch information
isidentical committed Dec 3, 2021
1 parent bd9d52b commit 45e2b78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -14,6 +14,7 @@
- Fix `match`/`case` statements that contain `match`/`case` soft keywords multiple
times, like `match re.match()` (#2661)
- Fix `case` statements with an inline body (#2665)
- Fix styling of starred expressions inside `match` subject (#2666)
- Fix assignment to environment variables in Jupyter Notebooks (#2642)
- Add `flake8-simplify` and `flake8-comprehensions` plugins (#2653)
- Fix determination of f-string expression spans (#2654)
Expand Down
2 changes: 2 additions & 0 deletions src/black/nodes.py
Expand Up @@ -97,6 +97,8 @@
syms.listmaker,
syms.testlist_gexp,
syms.testlist_star_expr,
syms.subject_expr,
syms.pattern,
}
TEST_DESCENDANTS: Final = {
syms.test,
Expand Down
5 changes: 5 additions & 0 deletions tests/data/pattern_matching_extras.py
Expand Up @@ -77,3 +77,8 @@ def func(match: case, case: match) -> case:
match match:
case case:
pass


match a, *b(), c:
case d, *f, g:
pass

0 comments on commit 45e2b78

Please sign in to comment.