Misc. follow-ups to single-element tuple patterns (#7698)

Just changes to internal comments and tests.

See comments in https://github.com/astral-sh/ruff/pull/7683.
This commit is contained in:
Charlie Marsh 2023-09-28 14:49:13 -04:00 committed by GitHub
parent 1c02fcd7ce
commit 46b85ab0a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 140 additions and 1 deletions

View file

@ -528,6 +528,48 @@ match pattern:
case a, b,:
pass
case (a, # comment
):
pass
case (a, b # comment
):
pass
case (a, b, # comment
):
pass
case ( # comment
a,
):
pass
case ( # comment
a, b
):
pass
case ( # comment
a, b,
):
pass
case (
# comment
a,):
pass
case (
# comment
a, b):
pass
case (
# comment
a, b,):
pass
```
## Output
@ -1086,6 +1128,60 @@ match pattern:
b,
):
pass
case (
a, # comment
):
pass
case (
a,
b, # comment
):
pass
case (
a,
b, # comment
):
pass
case ( # comment
a,
):
pass
case ( # comment
a,
b,
):
pass
case ( # comment
a,
b,
):
pass
case (
# comment
a,
):
pass
case (
# comment
a,
b,
):
pass
case (
# comment
a,
b,
):
pass
```