A literal "*" in RestructuredText

10,974

You could use the (somewhat ugly) backslash quotation: \*

EDIT: As an (somewhat ugly) addendum, if you are concerned about pylint warning about the backslash, you could add a r to the string literal: r""" ... docstring ... """. This was descibed in this pylint issue.

Having different text processing systems play nicely together destroys sometimes the aesthetics.

Share:
10,974
Sardathrion - against SE abuse
Author by

Sardathrion - against SE abuse

I am deeply saddened and worried by the abusing behaviour of stack exchange staff with regards to its users and have stopped all activities in this network. I urge you to do educate yourselves before it is too late. The final words… Firing mods and forced relicensing: is Stack Exchange still interested in cooperating with the community? Time line of events Sign the open letter, if you wish… I did. Nescire autem quid ante quam natus sis acciderit, id est semper esse puerum. Quid enim est aetas hominis, nisi ea memoria rerum veterum cum superiorum aetate contexitur? -- Cicero, Marcus Tullius (106-43BC)

Updated on June 06, 2022

Comments

  • Sardathrion - against SE abuse
    Sardathrion - against SE abuse about 2 years

    I am looking at this snippet of code:

    def ook(*args):
        """Some silly function.
    
        :param *args: Optional arguments.
        """
        ...
    

    And as soon as I run Sphinx, I get the oh-so helpful error:

    WARNING: Inline literal start-string without end-string.
    

    So, I tried param ``*``args, param :literal:'*' args and still get the warning.

    How do I have a literal '*' in restructuredText?