summaryrefslogtreecommitdiff
path: root/sphinx/directives/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/directives/__init__.py')
-rw-r--r--sphinx/directives/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py
index 4970f2696..5605a9065 100644
--- a/sphinx/directives/__init__.py
+++ b/sphinx/directives/__init__.py
@@ -28,7 +28,7 @@ strip_backslash_re = re.compile(r'\\(.)')
T = TypeVar('T')
-def optional_int(argument: str) -> int:
+def optional_int(argument: str) -> int | None:
"""
Check for an integer argument or None value; raise ``ValueError`` if not.
"""
@@ -61,8 +61,8 @@ class ObjectDescription(SphinxDirective, Generic[T]):
# types of doc fields that this directive handles, see sphinx.util.docfields
doc_field_types: list[Field] = []
domain: str | None = None
- objtype: str | None = None
- indexnode: addnodes.index | None = None
+ objtype: str # set when `run` method is called
+ indexnode: addnodes.index
# Warning: this might be removed in future version. Don't touch this from extensions.
_doc_field_type_map: dict[str, tuple[Field, bool]] = {}