diff options
author | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2022-12-30 21:13:29 +0000 |
---|---|---|
committer | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-01-01 20:48:38 +0000 |
commit | 26f79b0d2dd88b353ac65623897bdfbe8bc07cab (patch) | |
tree | 0d2f0c752cf1f49a45cde1d7f414d75a6114f1ce /sphinx/ext/autodoc/directive.py | |
parent | f4c8a0a68e0013808d169357c9f77ebdf19d0f4e (diff) | |
download | sphinx-git-26f79b0d2dd88b353ac65623897bdfbe8bc07cab.tar.gz |
Use PEP 595 types
Diffstat (limited to 'sphinx/ext/autodoc/directive.py')
-rw-r--r-- | sphinx/ext/autodoc/directive.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py index 501912146..ff0a3eb05 100644 --- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any, Callable, Dict, List, Optional, Set, Type +from typing import Any, Callable, Optional from docutils import nodes from docutils.nodes import Element, Node @@ -48,12 +48,12 @@ class DocumenterBridge: self._reporter = reporter self.genopt = options self.lineno = lineno - self.record_dependencies: Set[str] = set() + self.record_dependencies: set[str] = set() self.result = StringList() self.state = state -def process_documenter_options(documenter: Type[Documenter], config: Config, options: Dict +def process_documenter_options(documenter: type[Documenter], config: Config, options: dict ) -> Options: """Recognize options of Documenter from user input.""" for name in AUTODOC_DEFAULT_OPTIONS: @@ -80,7 +80,7 @@ def process_documenter_options(documenter: Type[Documenter], config: Config, opt def parse_generated_content(state: RSTState, content: StringList, documenter: Documenter - ) -> List[Node]: + ) -> list[Node]: """Parse an item of content generated by Documenter.""" with switch_source_input(state, content): if documenter.titles_allowed: @@ -108,7 +108,7 @@ class AutodocDirective(SphinxDirective): optional_arguments = 0 final_argument_whitespace = True - def run(self) -> List[Node]: + def run(self) -> list[Node]: reporter = self.state.document.reporter try: |