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

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

bug#38318: [PATCH] Highlight Python special attributes.


From: Hong Xu
Subject: bug#38318: [PATCH] Highlight Python special attributes.
Date: Thu, 21 Nov 2019 16:29:38 -0800
User-agent: Zoho Mail

* lisp/progmodes/python.el (python-font-lock-keywords-level-2): Add
special attributes
---
 lisp/progmodes/python.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 37e0ccf71987..aa7252e156d9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -567,8 +567,14 @@ python-font-lock-keywords-level-2
            "intern"
            ;; Python 3:
            "ascii" "breakpoint" "bytearray" "bytes" "exec"
-           ;; Extra:
-           "__all__" "__doc__" "__name__" "__package__")
+           ;; Special attributes:
+           ;; https://docs.python.org/3/reference/datamodel.html
+           "__annotations__" "__closure__" "__code__"
+           "__defaults__" "__dict__" "__doc__" "__globals__"
+           "__kwdefaults__" "__name__" "__module__" "__package__"
+           "__qualname__"
+           ;; Extras:
+           "__all__")
           symbol-end) . font-lock-builtin-face))
   "Font lock keywords to use in python-mode for level 2 decoration.
 
-- 
2.18.1






reply via email to

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