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

SyntaxError for PEP 634 Structural Pattern Matching #1634

Closed
radupotop opened this issue Jan 4, 2023 · 1 comment
Closed

SyntaxError for PEP 634 Structural Pattern Matching #1634

radupotop opened this issue Jan 4, 2023 · 1 comment

Comments

@radupotop
Copy link

I get a E999 SyntaxError: invalid syntax. Got unexpected token whenever structural pattern matching occurs. e.g.:

def http_error(status):
    match status:
        case 400:
            return "Bad request"
        case 404:
            return "Not found"
        case 418:
            return "I'm a teapot"
        case _:
            return "Something's wrong with the internet"

I'm running Python 3.10.9

@charliermarsh
Copy link
Member

Yeah this is the one language feature we don't yet support unfortunately. It's being tracked here: #282.

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

No branches or pull requests

2 participants