The language interpreter is set to a Python 3.9 version:

But a Python scratch file is being parsed by some kind of 3.6 interpreter:

Note that I created in two different scratch files and the same error occurs. Why would this happen and is there a workaround [short of creating an entirely new project from scratch]?
I am on Pycharm Professional 2021.3.1
Update based on answer by @TurePaisson he though maybe the Code is compatible with specific Python were set. That was a shrewd guess - but turns out I have not set that:


Update The following snippet can be used to test python3.6 vs 3.8+
x = (y := 3) + 7
In the preferences dialog, search for "versions" and you will find, under Editor/Inspections, an inspection "Code is compatible with specific Python versions" with checkboxes for which versions to check against.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With