diff options
author | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2022-12-30 20:14:18 +0000 |
---|---|---|
committer | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-01-01 20:48:37 +0000 |
commit | f4c8a0a68e0013808d169357c9f77ebdf19d0f4e (patch) | |
tree | f952fa0106f7b93db5b5a21b801f12566f2ebaee /sphinx/util/nodes.py | |
parent | 0b1efd7756e05b238c28c62e3946a222cacbd229 (diff) | |
download | sphinx-git-f4c8a0a68e0013808d169357c9f77ebdf19d0f4e.tar.gz |
Insert ``from __future__ import annotations``
Diffstat (limited to 'sphinx/util/nodes.py')
-rw-r--r-- | sphinx/util/nodes.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py index 9494b61de..4f1c2dac7 100644 --- a/sphinx/util/nodes.py +++ b/sphinx/util/nodes.py @@ -1,5 +1,7 @@ """Docutils node-related utility functions for Sphinx.""" +from __future__ import annotations + import re import unicodedata from typing import (TYPE_CHECKING, Any, Callable, Iterable, List, Optional, Set, Tuple, Type, @@ -45,7 +47,8 @@ class NodeMatcher: A special value ``typing.Any`` matches any kind of node-attributes. For example, following example searches ``reference`` node having ``refdomain`` attributes:: - from typing import Any + from __future__ import annotations +from typing import Any matcher = NodeMatcher(nodes.reference, refdomain=Any) doctree.findall(matcher) # => [<reference ...>, <reference ...>, ...] |