I've moved tests to python-tests.el and added another fixes:
 
assignment feature:
`for var in range(3)` highlight var as font-lock-variable-name-face
`var1[ii] = 1; t.var2[jj] = 2` highlight var1, var2 as font-lock-variable-name-face
 
type feature:
support nested optional types up to 3 level deep, for example `tuple[tuple, list[Lvl1 | Lvl2[Lvl3[Lvl3], Lvl2]]]`
 
 
Summary of all changes in the patch:
 
keyword feature:
Add "is not"  to the `python--treesit-keywords` list.
 
assignment feature:
For all examples,
`for var in range(3)`
`var1[ii] = 1; t.var2[jj] = 2`
`var := 3`
`var *= 3`
highlight var as font-lock-variable-name-face
 
string feature:
Fix fontification of strings inside of f-strings interpolation,
e.g. for f"beg {'nested'}" - 'nested' was not fontified as string.
 
function feature:
Do not override the face of builtin functions (all, bytes etc.) with
the function call face
 
type feature:
Fontify built-ins (dict,list,etc.) as types when they are used in type hints.
E.g. def func(v:dict[ list[ tuple[str] ], int | None] | None):
 
 
 
 
 
 
29.11.2023, 17:05, "Eli Zaretskii" <eliz@gnu.org>:
 Date: Sun, 26 Nov 2023 04:17:59 +0200
 Cc: dvzubarev@yandex.ru, 67061@debbugs.gnu.org
 From: Dmitry Gutov <dmitry@gutov.dev>
 
 On 25/11/2023 11:35, Eli Zaretskii wrote:
 > Ping! Ping! Yuan, could you please chime in? We are waiting for
 > Denis's legal paperwork to come through, but meanwhile I'd like your
 > opinions on the changes he proposed, and also on whether this should
 > be installed on the emacs-29 branch or on master.
 
 FWIW, the changes and the explanations look reasonable to me. The
 presence of tests is a good sign too (though they'll probably need to
 move to another file).
 
 The fixes are relevant to Emacs 29 for sure.
 
 I don't know at what stage we're going to start worrying when adding new
 elements to the queries, though, in fear of breaking compatibility with
 some potential older version of the grammar.


Thanks.

Yuan, please chime in, I'm waiting for your response.