Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-07 05:15:54 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-07 13:36:41 +0300
commit28e5e66f78f46e5e44b053297a0c90a718effcf7 (patch)
tree5290cb6113599dadf6a47f247683dfa06183151f /sphinx/config.py
parent1fb79cff452144761a09fdd0feee28724f1b904b (diff)
Use typing.NamedTuple instead of collections.namedtuple as possible
Diffstat (limited to 'sphinx/config.py')
-rw-r--r--sphinx/config.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/config.py b/sphinx/config.py
index 87007c33d..652682168 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -39,9 +39,11 @@ CONFIG_FILENAME = 'conf.py'
UNSERIALIZABLE_TYPES = (type, types.ModuleType, types.FunctionType)
copyright_year_re = re.compile(r'^((\d{4}-)?)(\d{4})(?=[ ,])')
-ConfigValue = NamedTuple('ConfigValue', [('name', str),
- ('value', Any),
- ('rebuild', Union[bool, str])])
+
+class ConfigValue(NamedTuple):
+ name: str
+ value: Any
+ rebuild: Union[bool, str]
def is_serializable(obj: Any) -> bool: