mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
use a upper-case name for the list of singleton names
This commit is contained in:
@@ -50,7 +50,7 @@ _token_regex = re.compile(
|
|||||||
r'|"(?:\\"|[^"])*"'
|
r'|"(?:\\"|[^"])*"'
|
||||||
r"|'(?:\\'|[^'])*')"
|
r"|'(?:\\'|[^'])*')"
|
||||||
)
|
)
|
||||||
_singletons = ("None", "True", "False", "Ellipsis")
|
_SINGLETONS = ("None", "True", "False", "Ellipsis")
|
||||||
|
|
||||||
|
|
||||||
class GoogleDocstring:
|
class GoogleDocstring:
|
||||||
@@ -934,7 +934,7 @@ def _convert_numpy_type_spec(_type: str, location: str = None, translations: dic
|
|||||||
translation = translations.get(obj, obj)
|
translation = translations.get(obj, obj)
|
||||||
|
|
||||||
# use :class: (the default) only if obj is not a standard singleton
|
# use :class: (the default) only if obj is not a standard singleton
|
||||||
if translation in _singletons and default_translation == ":class:`%s`":
|
if translation in _SINGLETONS and default_translation == ":class:`%s`":
|
||||||
default_translation = ":obj:`%s`"
|
default_translation = ":obj:`%s`"
|
||||||
elif translation == "..." and default_translation == ":class:`%s`":
|
elif translation == "..." and default_translation == ":class:`%s`":
|
||||||
# allow referencing the builtin ...
|
# allow referencing the builtin ...
|
||||||
|
Reference in New Issue
Block a user