Skip to content

Commit ca74f85

Browse files
committed
Fix type checking if-block
1 parent 6c28c4a commit ca74f85

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

sphinxcontrib/prettyspecialmethods.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010

1111
from __future__ import annotations
1212

13+
from typing import Any
14+
1315
import sphinx.addnodes as SphinxNodes
1416
from docutils.nodes import Text, emphasis, inline
17+
from sphinx.application import Sphinx
1518
from sphinx.transforms import SphinxTransform
1619

17-
if False:
18-
# For type annotations
19-
from typing import Any, Dict # noqa
20-
from sphinx.application import Sphinx # noqa
21-
2220
__version__ = "0.2.dev"
2321

2422

@@ -217,8 +215,7 @@ def show_special_methods(app, what, name, obj, skip, options):
217215
return False
218216

219217

220-
def setup(app):
221-
# type: (Sphinx) -> Dict[str, Any]
218+
def setup(app: Sphinx) -> dict[str, Any]:
222219
app.add_transform(PrettifySpecialMethods)
223220
app.setup_extension("sphinx.ext.autodoc")
224221
app.connect("autodoc-skip-member", show_special_methods)

0 commit comments

Comments
 (0)