from typing import Final
def f() -> bool:
return bool()
ABC: Final
if f():
ABC = 1
ABC = 2 # no error
playground
also when assigned in function
from typing import Final
ABC: Final
def f():
ABC = 1 # no error
also when not assigned at all
from typing import Final
ABC: Final # no error
Version
1227dd672