mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
make sure singletons actually use :obj:
This commit is contained in:
parent
fc43f494ac
commit
2b981b6abd
@ -904,7 +904,7 @@ def _token_type(token):
|
|||||||
def _convert_numpy_type_spec(_type, translations={}):
|
def _convert_numpy_type_spec(_type, translations={}):
|
||||||
def convert_obj(obj, translations, default_translation):
|
def convert_obj(obj, translations, default_translation):
|
||||||
# use :class: (the default) only if obj is not a standard singleton (None, True, False)
|
# use :class: (the default) only if obj is not a standard singleton (None, True, False)
|
||||||
if obj in (None, True, False) and default_translation == ":class:`{}`":
|
if obj in ("None", "True", "False") and default_translation == ":class:`{}`":
|
||||||
default_translation = ":obj:`{}`"
|
default_translation = ":obj:`{}`"
|
||||||
|
|
||||||
return translations.get(obj, default_translation.format(obj))
|
return translations.get(obj, default_translation.format(obj))
|
||||||
|
@ -2126,8 +2126,8 @@ definition_after_normal_text : int
|
|||||||
|
|
||||||
converted_types = (
|
converted_types = (
|
||||||
"",
|
"",
|
||||||
":obj:`str`",
|
":class:`str`",
|
||||||
":obj:`int` or :obj:`float` or :obj:`None`",
|
":class:`int` or :class:`float` or :obj:`None`",
|
||||||
'``{"F", "C", "N"}``',
|
'``{"F", "C", "N"}``',
|
||||||
"``{'F', 'C', 'N'}``",
|
"``{'F', 'C', 'N'}``",
|
||||||
)
|
)
|
||||||
@ -2171,11 +2171,11 @@ definition_after_normal_text : int
|
|||||||
:param param1: the data to work on
|
:param param1: the data to work on
|
||||||
:type param1: DataFrame
|
:type param1: DataFrame
|
||||||
:param param2: a parameter with different types
|
:param param2: a parameter with different types
|
||||||
:type param2: :obj:`int` or :obj:`float` or :obj:`None`
|
:type param2: :class:`int` or :class:`float` or :obj:`None`
|
||||||
:param param3: a optional mapping
|
:param param3: a optional mapping
|
||||||
:type param3: :term:`dict-like <mapping>`, *optional*
|
:type param3: :term:`dict-like <mapping>`, *optional*
|
||||||
:param param4: a optional parameter with different types
|
:param param4: a optional parameter with different types
|
||||||
:type param4: :obj:`int` or :obj:`float` or :obj:`None`, *optional*
|
:type param4: :class:`int` or :class:`float` or :obj:`None`, *optional*
|
||||||
:param param5: a optional parameter with fixed values
|
:param param5: a optional parameter with fixed values
|
||||||
:type param5: ``{"F", "C", "N"}``, *optional*
|
:type param5: ``{"F", "C", "N"}``, *optional*
|
||||||
""")
|
""")
|
||||||
|
Loading…
Reference in New Issue
Block a user