summaryrefslogtreecommitdiff
path: root/sphinx/util
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-09-23 10:54:54 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-09-23 10:59:01 +0900
commitd13b86e02fc22ca29bd06a57151afad77b81e832 (patch)
tree7d1c1f005e1cf89876a4c3032a68af13c2cc1296 /sphinx/util
parent3774c124f8936ec6ca75d935ba57926d15d92f5d (diff)
downloadsphinx-git-d13b86e02fc22ca29bd06a57151afad77b81e832.tar.gz
Close #9664: autodoc: autodoc-process-bases supports reST snippet
This allows to inject a reST snippet through autodoc-process-bases event. It helps to modify the base classes of any class to the expected mark-up'ed text by custom extension.
Diffstat (limited to 'sphinx/util')
-rw-r--r--sphinx/util/typing.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
index 7380f4783..87707d48f 100644
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -113,6 +113,8 @@ def restify(cls: Optional[Type]) -> str:
return ':py:obj:`None`'
elif cls is Ellipsis:
return '...'
+ elif isinstance(cls, str):
+ return cls
elif cls in INVALID_BUILTIN_CLASSES:
return ':py:class:`%s`' % INVALID_BUILTIN_CLASSES[cls]
elif inspect.isNewType(cls):