Skip to content

Commit 968c894

Browse files
committed
replace Optional[T] with T | None syntax
because min python version (`>= 3.9`) is sufficient
1 parent bfed918 commit 968c894

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/conf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from io import StringIO
88
from pathlib import Path
99
import time
10-
from typing import Optional, cast, Dict
10+
from typing import cast
1111
from importlib.metadata import version as get_version
1212
import docutils
1313
from sphinx.application import Sphinx
@@ -138,9 +138,9 @@
138138

139139
class CliBadge(SphinxRole):
140140
badge_type: str
141-
badge_icon: Optional[str] = None
142-
href: Optional[str] = None
143-
href_title: Optional[str] = None
141+
badge_icon: str | None = None
142+
href: str | None = None
143+
href_title: str | None = None
144144

145145
def run(self):
146146
permission_link = ""
@@ -281,7 +281,7 @@ def setup(app: Sphinx):
281281
for line in usage.splitlines():
282282
doc.write(f" {line[start:]}\n")
283283

284-
sub_commands: Optional[argparse.Action] = None
284+
sub_commands: argparse.Action | None = None
285285

286286
doc.write("\n\nPositional Arguments\n")
287287
doc.write("--------------------\n\n")
@@ -325,7 +325,7 @@ def setup(app: Sphinx):
325325
doc.write("\n ".join(help.splitlines()) + "\n")
326326

327327
if sub_commands is not None:
328-
choices = cast(Dict[str, argparse.ArgumentParser], sub_commands.choices)
328+
choices = cast(dict[str, argparse.ArgumentParser], sub_commands.choices)
329329
doc.write("\n\nSubcommands\n")
330330
doc.write("-----------\n")
331331
for sub_cmd in choices:

0 commit comments

Comments
 (0)