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

handle match-case using a function argument #2671

Closed
buchs opened this issue Feb 8, 2023 · 4 comments
Closed

handle match-case using a function argument #2671

buchs opened this issue Feb 8, 2023 · 4 comments

Comments

@buchs
Copy link

buchs commented Feb 8, 2023

I saw another issue about documenting a work-around for match/case. I am not sure if that is still relevant.

minimal snippet:

$ cat ruff.py
def f(arga):
match arga:
case 'hello':
print('you passed hello')

import sys
f(sys.argv[1])

Command: ruff check ruff.py

No ruff settings (no pyproject.toml).

$ ruff --version
ruff 0.0.243

Error:

$ ruff check ruff.py
error: Failed to parse ruff.py: invalid syntax. Got unexpected token 'arga' at line 2 column 10
ruff.py:2:11: E999 SyntaxError: invalid syntax. Got unexpected token 'arga'

@buchs
Copy link
Author

buchs commented Feb 8, 2023

And, thanks for working on and producing ruff.

@ngnpope
Copy link
Contributor

ngnpope commented Feb 8, 2023

Duplicate of #282.

@charliermarsh
Copy link
Member

Thanks for filing! Closing for now as it's being tracked elsewhere.

@charliermarsh
Copy link
Member

Fixed as of v0.0.250.

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

3 participants