Issue
I am using Spyder 5.3.1 and Python 3.10.4 within a virtual environment, on Windows 10.
I know that with Python 3.10 came the match
statement.
However, whenever I use the match
keyword inside a script, the following error appears:
Code Analysis
Invalid syntax (pyflakes E)
But I can run the script correctly without any problem. So what can be the issue here?
Moreover, if I try directly in the IPython console, the match
keyword is immediately recognized.
Solution
It's not so much an issue with Spyder as it is with the Pyflakes system it uses for linting code.
match
is a new (soft) keyword in Python 3.10. Pyflakes 2.4.0 only supports up to Python 3.8 currently.
Pyflakes 2.5.0 is not out yet, but will cover up to Python 3.11, and should lint the new match
keyword properly.
Answered By - jonsca
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.