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

Black does not accept multiple top-level as-expressions on a case #2715

Closed
isidentical opened this issue Dec 21, 2021 · 0 comments · Fixed by #2716
Closed

Black does not accept multiple top-level as-expressions on a case #2715

isidentical opened this issue Dec 21, 2021 · 0 comments · Fixed by #2716
Labels
C: parser How we parse code. Or fail to parse it. T: bug Something isn't working

Comments

@isidentical
Copy link
Collaborator

I've modified my script from the original issue to include the whole Lib/test/test_patma.py. It uncovered one potential bug, but other than the good news is we are fully compatible (even though it takes a ridiculously large amount of time to parse that file, twice (due to the second pass)). I still haven't figured out the best way to optimize, but that is on my bucket list.

The only example we can't parse is the following:

def test_patma_238(self):
    x = ((0, 1), (2, 3))
    match x:
        case ((a as b, c as d) as e) as w, ((f as g, h) as i) as z:
            y = 0

Where we have 2 top-level as-expressions (blabla as bla, blabla2 as bla2) it fails to parse since it doesn't recognize as expressions on the individual unparenthesized case expressions.

@isidentical isidentical added the T: bug Something isn't working label Dec 21, 2021
@ichard26 ichard26 added the C: parser How we parse code. Or fail to parse it. label Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: parser How we parse code. Or fail to parse it. T: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants