aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorEli Zaretskii2024-05-25 08:00:48 -0400
committerEli Zaretskii2024-05-25 08:00:48 -0400
commited7e57697572f641b50d24071867675bf89bed0f (patch)
tree4c529184ed370d39103b2750e79104a9d48452ba /lisp/progmodes/python.el
parentcb67c34bcfe525cbab75d7af8c6e6244d61eb228 (diff)
parent4f0121f8dbe2ca0ec8fe2831353f01782e5e6b9d (diff)
downloademacs-ed7e57697572f641b50d24071867675bf89bed0f.tar.gz
emacs-ed7e57697572f641b50d24071867675bf89bed0f.zip
Merge from origin/emacs-29
4f0121f8dbe Avoid assertion violations in displaying under 'outline-m... 1bf65836622 Improve documentation of 'no-special-glyphs' frame parameter 3647645e948 Fix Python font lock of chained assignment statement 3291dea441f Fix example in Calc manual 350ae75f5c1 Avoid crashes on MS-Windows due to invalid UNC file names ccf8dba44a3 ; * lisp/face-remap.el (text-scale-adjust): Doc fix. 5ab144c77cd ; Improve documentation of backing up files
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 360936c9efd..79e383a1c1a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -845,6 +845,17 @@ sign in chained assignment."
845 (match-beginning 2)) ; limit the search until the assignment 845 (match-beginning 2)) ; limit the search until the assignment
846 nil 846 nil
847 (1 font-lock-variable-name-face))) 847 (1 font-lock-variable-name-face)))
848 ;; single assignment with type hints, e.g.
849 ;; a: int = 5
850 ;; b: Tuple[Optional[int], Union[Sequence[str], str]] = (None, 'foo')
851 ;; c: Collection = {1, 2, 3}
852 ;; d: Mapping[int, str] = {1: 'bar', 2: 'baz'}
853 (,(python-font-lock-assignment-matcher
854 (python-rx grouped-assignment-target (* space)
855 (? ?: (* space) (+ not-simple-operator) (* space))
856 (group assignment-operator)))
857 (1 font-lock-variable-name-face)
858 (2 'font-lock-operator-face))
848 ;; special cases 859 ;; special cases
849 ;; (a) = 5 860 ;; (a) = 5
850 ;; [a] = 5, 861 ;; [a] = 5,