2

I got a strange issue with ruff (0.0.209) and python 3.10.9 interpreter when I use match/case syntax. For instance, this simple code :

from http import HTTPStatus

http_status = HTTPStatus.OK

match http_status:
    case HTTPStatus.OK:
        print("OK!")

    case HTTPStatus.BAD_REQUEST:
        print("Bad, bad Zoot!")

    case _:
        print("Just a flesh wound.")

Raise a 5:8: E999 SyntaxError: invalid syntax. Got unexpected token 'http_status'

At the same time, ruff argue that it now support python3.11. Who is lying ? :)

I tried to update ruff with last version

Marcel Wilson
  • 3,842
  • 1
  • 26
  • 55
Romain
  • 334
  • 4
  • 10

1 Answers1

6

It's not supported as of 2023-01-06 unfortunately. This is the tracking issue.

Update (2023-03-11): Get ruff 0.0.250 or above.

erickg
  • 975
  • 7
  • 18
  • 4
    Thanks ! That's what I've been looking for :) Its not what I can call "python 3.11 compliant" btw – Romain Jan 09 '23 at 10:49