emacs-version: "GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.17.4)
 of 2021-01-22"

Sometimes assignments are not fontified or fontified incorrectly.
Steps to reproduce:
1. Create a python file with contents
> def foo(bar: int) -> str:
>     spam = bar
>     eggs = f'lkjahsd {spam}'
>     return eggs
>
>
> def foo2(bar: int):
>     spam = bar
>     eggs = f'lkjahsd {spam}'
>     return eggs
>
>
> def foo3(bar):
>     spam = bar
>     eggs = f'lkjahsd {spam}'
>     return eggs

2. Open the file with emacs -Q

You will see that variables `spam` and `bar` are highlighted differently
in all 3 cases.
`spam`:
  not highlighted at all in cases `foo` and `foo2`
`bar`:
  not highlighted correctly in cases `foo` and `foo3`

Best regards,
Mykhailo