diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-07 11:15:54 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-07 19:36:41 +0900 |
commit | 28e5e66f78f46e5e44b053297a0c90a718effcf7 (patch) | |
tree | 5290cb6113599dadf6a47f247683dfa06183151f /sphinx/util/i18n.py | |
parent | 1fb79cff452144761a09fdd0feee28724f1b904b (diff) | |
download | sphinx-git-28e5e66f78f46e5e44b053297a0c90a718effcf7.tar.gz |
Use typing.NamedTuple instead of collections.namedtuple as possible
Diffstat (limited to 'sphinx/util/i18n.py')
-rw-r--r-- | sphinx/util/i18n.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sphinx/util/i18n.py b/sphinx/util/i18n.py index 1cb75637c..c1da94429 100644 --- a/sphinx/util/i18n.py +++ b/sphinx/util/i18n.py @@ -11,10 +11,9 @@ import gettext import os import re import warnings -from collections import namedtuple from datetime import datetime, timezone from os import path -from typing import Callable, Generator, List, Set, Tuple +from typing import Callable, Generator, List, NamedTuple, Set, Tuple import babel.dates from babel.messages.mofile import write_mo @@ -34,7 +33,11 @@ if False: logger = logging.getLogger(__name__) -LocaleFileInfoBase = namedtuple('CatalogInfo', 'base_dir,domain,charset') + +class LocaleFileInfoBase(NamedTuple): + base_dir: str + domain: str + charset: str class CatalogInfo(LocaleFileInfoBase): |