py-mon icon indicating copy to clipboard operation
py-mon copied to clipboard

Strange behavior using match statements with python 3.12.6 and py-mon 2.0.5

Open carlospalavecino opened this issue 4 months ago • 0 comments

Hi, I found a strange behavior using py-mon when I want to use match statements. Running the same script with python match.py works as expected.

I checked the python docs and the code seems to be correct. Even I did a fairly basic abstraction to discart code errors.Could it be possible that there is some conflict with the keyword "match"?

I am running the script on macos sonoma and python 3.12.6 and py-mon 2.0.5 Thanks in advance.

example match.py

myvar = "Hello"

match myvar:
    case "Hello":
        print("Hello World")
    case "Hello 2":
        print("Hello World 2")
    case _:
        print("No match")

stdout

[pymon] starting match.py
  File ".../match.py", line 3
    match myvar:
          ^
SyntaxError: invalid syntax

carlospalavecino avatar Sep 30 '24 18:09 carlospalavecino