summaryrefslogtreecommitdiff
path: root/sphinx/transforms/post_transforms/code.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-07-16 02:24:07 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-07-16 23:17:50 +0900
commit68327ba2e617807eb3c59e9964cebd0c5f2642f9 (patch)
treeb57c70c8222747e95e9f7ef0b71afc2acefe1c20 /sphinx/transforms/post_transforms/code.py
parent70d521ad9c1c066a081f81e9af618dd05d372486 (diff)
downloadsphinx-git-68327ba2e617807eb3c59e9964cebd0c5f2642f9.tar.gz
refactor: namedtuples with PEP 526
Apply PEP 526 based variable annotation style to namedtuples. It is available since python 3.6.
Diffstat (limited to 'sphinx/transforms/post_transforms/code.py')
-rw-r--r--sphinx/transforms/post_transforms/code.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/transforms/post_transforms/code.py b/sphinx/transforms/post_transforms/code.py
index add35647b..f6ddb521f 100644
--- a/sphinx/transforms/post_transforms/code.py
+++ b/sphinx/transforms/post_transforms/code.py
@@ -21,9 +21,10 @@ from sphinx.ext import doctest
from sphinx.transforms import SphinxTransform
-HighlightSetting = NamedTuple('HighlightSetting', [('language', str),
- ('force', bool),
- ('lineno_threshold', int)])
+class HighlightSetting(NamedTuple):
+ language: str
+ force: bool
+ lineno_threshold: int
class HighlightLanguageTransform(SphinxTransform):