Skip to content

Commit f9b8c74

Browse files
xuhdevlarsmagne
authored andcommitted
font-lock special attributes in python-mode
* lisp/progmodes/python.el (python-font-lock-keywords-level-2): Add special attributes (bug#38318).
1 parent f566795 commit f9b8c74

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lisp/progmodes/python.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,14 @@ class declarations.")
567567
"intern"
568568
;; Python 3:
569569
"ascii" "breakpoint" "bytearray" "bytes" "exec"
570-
;; Extra:
571-
"__all__" "__doc__" "__name__" "__package__")
570+
;; Special attributes:
571+
;; https://docs.python.org/3/reference/datamodel.html
572+
"__annotations__" "__closure__" "__code__"
573+
"__defaults__" "__dict__" "__doc__" "__globals__"
574+
"__kwdefaults__" "__name__" "__module__" "__package__"
575+
"__qualname__"
576+
;; Extras:
577+
"__all__")
572578
symbol-end) . font-lock-builtin-face))
573579
"Font lock keywords to use in python-mode for level 2 decoration.
574580

0 commit comments

Comments
 (0)