{ } Raw JSON

bundles / papyri 0.0.10 / papyri / examples / example_backtick_suffix

function

papyri.examples:example_backtick_suffix

source: /papyri/examples.py :405

Signature

def   example_backtick_suffix ( )  →  None

Summary

Edge cases: interpreted text with trailing alphabetic suffix.

Extended Summary

RST requires the closing backtick to be followed by whitespace or punctuation, not alphanumeric characters. Writing `None`s is therefore invalid RST; the spec-correct form is \`None\`\ s (backslash-escaped inline whitespace). Sphinx tolerates the invalid form via lenient parsing, so it is widespread in scientific docstrings.

Papyri detects the word`suffix pattern and splits it into a styled InlineRole node followed by a plain Text node, rather than corrupting the value by replacing the stray backtick with a quote.

Plain (no role):

  • Returns `None`s when the input is empty.

  • A list of `ndarray`s with matching shapes.

  • Both `int`s and `float`s are valid.

With an explicit role:

  • Pass :data:`True`s or :data:`False`s.

  • A sequence of :class:`str`s is also accepted.

Correctly written RST (backslash escape, no heuristic needed):

  • Returns Nones when the input is empty.

  • A list of ndarrays with matching shapes.

Aliases

  • papyri.examples.example_backtick_suffix