diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-07-15 20:24:07 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-07-16 17:17:50 +0300 |
commit | 68327ba2e617807eb3c59e9964cebd0c5f2642f9 (patch) | |
tree | b57c70c8222747e95e9f7ef0b71afc2acefe1c20 /sphinx/events.py | |
parent | 70d521ad9c1c066a081f81e9af618dd05d372486 (diff) |
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/events.py')
-rw-r--r-- | sphinx/events.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/events.py b/sphinx/events.py index 3a3753895..9d7402554 100644 --- a/sphinx/events.py +++ b/sphinx/events.py @@ -25,9 +25,11 @@ if TYPE_CHECKING: logger = logging.getLogger(__name__) -EventListener = NamedTuple('EventListener', [('id', int), - ('handler', Callable), - ('priority', int)]) + +class EventListener(NamedTuple): + id: int + handler: Callable + priority: int # List of all known core events. Maps name to arguments description. |