In order to type hint a variable used in a walrus expression, I put the type hint outside of the expression like in the following example (test.py):
a: int
if a := 3:
print(a)
print(a)
Variable "a" is defined in both places
In pyflakes version 3.2.0 this produced no errors
pip install flake8==7.1.2 pyflakes==3.2.0
In pyflakes version 3.3.0 this produces F821 even though "a" is defined
pip install flake8==7.2.0 pyflakes==3.3.0
$ flake8 test.py
test.py:3:11: F821 undefined name 'a'
test.py:5:7: F821 undefined name 'a'
I am on Windows with Python version 3.12.8