File: docstrings.py

package info (click to toggle)
python-sybil 9.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,148 kB
  • sloc: python: 4,510; makefile: 90
file content (51 lines) | stat: -rw-r--r-- 939 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def r_prefixed_docstring():
    r"""
    Wat? Why?!
    """


def function_with_codeblock_in_middle(text):
    """
    My comment

    .. code-block:: python
        function_with_codeblock_in_middle("Hello World")

    Some more documentation.
    """
    assert text == 'Hello World'


def function_with_single_line_codeblock_at_end(text):
    """
    My comment

    .. code-block:: python
        function_with_single_line_codeblock_at_end("Hello World")
    """
    assert text == 'Hello World'


def function_with_multi_line_codeblock_at_end(text):
    """
    My comment

    .. code-block:: python
        function_with_multi_line_codeblock_at_end("Hello")
        function_with_multi_line_codeblock_at_end("World")
    """
    assert text in ('Hello', 'World')


def decorator(fn):
    """
    Example:

    >>> def decorated():
    ...     \"\"\"docstring of a decorated function\"\"\"

    """


def ellipsis_as_body():
    ...