bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69357: [PATCH] Improve fontification of Python assignment statement


From: Stefan Kangas
Subject: bug#69357: [PATCH] Improve fontification of Python assignment statement with type hints
Date: Sat, 18 May 2024 20:23:24 +0000

close 69357 30.1
thanks

kobarity <kobarity@gmail.com> writes:

> In python-mode (not python-ts-mode), "List" in the type hints of the
> following code are fontified as variable names.
>
> #+begin_src python
> a: List[List[CustomInt], List[CustomInt]] = []
> #+end_src
>
> This is due to misinterpretation as a multiple assignment statement
> such as:
>
> #+begin_src python
> a, b = 1, 2
> #+end_src
>
> To address this issue and to improve fontification, I suggest to
> fontify type hints in the assignment statement as type names before
> processing multiple assignment statements, as in the attached patch.

Your analysis seems correct, and the fix works here.  It's very nice to
see tests for this too, as always.

Thus, I've now pushed your change to master (commit c97e7a2da2e).
I'm consequently closing this bug report.

Thanks for your contribution!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]