make sure singletons actually use :obj:

This commit is contained in:
Keewis 2020-07-12 23:19:26 +02:00
parent fc43f494ac
commit 2b981b6abd
2 changed files with 5 additions and 5 deletions

View File

@ -904,7 +904,7 @@ def _token_type(token):
def _convert_numpy_type_spec(_type, translations={}):
def convert_obj(obj, translations, default_translation):
# 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:`{}`"
return translations.get(obj, default_translation.format(obj))

View File

@ -2126,8 +2126,8 @@ definition_after_normal_text : int
converted_types = (
"",
":obj:`str`",
":obj:`int` or :obj:`float` or :obj:`None`",
":class:`str`",
":class:`int` or :class:`float` or :obj:`None`",
'``{"F", "C", "N"}``',
"``{'F', 'C', 'N'}``",
)
@ -2171,11 +2171,11 @@ definition_after_normal_text : int
:param param1: the data to work on
:type param1: DataFrame
: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
:type param3: :term:`dict-like <mapping>`, *optional*
: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
:type param5: ``{"F", "C", "N"}``, *optional*
""")