| 1 |
""" |
| 2 |
.. autosummary:: |
| 3 |
|
| 4 |
module_attr |
| 5 |
C.class_attr |
| 6 |
C.instance_attr |
| 7 |
C.prop_attr1 |
| 8 |
C.prop_attr2 |
| 9 |
C.C2 |
| 10 |
""" # NoQA: D212 |
| 11 |
|
| 12 |
|
| 13 |
def with_sentence(): |
| 14 |
"""I have a sentence which |
| 15 |
spans multiple lines. Then I have |
| 16 |
more stuff |
| 17 |
""" |
| 18 |
pass |
| 19 |
|
| 20 |
|
| 21 |
def no_sentence(): |
| 22 |
"""this doesn't start with a |
| 23 |
capital. so it's not considered |
| 24 |
a sentence |
| 25 |
""" |
| 26 |
pass |
| 27 |
|
| 28 |
|
| 29 |
def empty_line(): |
| 30 |
"""This is the real summary |
| 31 |
|
| 32 |
However, it did't end with a period. |
| 33 |
""" |
| 34 |
pass |
| 35 |
|
| 36 |
|
| 37 |
#: This is a module attribute |
| 38 |
#: |
| 39 |
#: value is integer. |
| 40 |
module_attr = 1 |
| 41 |
|
| 42 |
|
| 43 |
class C: |
| 44 |
"""My C class |
| 45 |
|
| 46 |
with class_attr attribute |
| 47 |
""" |
| 48 |
|
| 49 |
#: This is a class attribute |
| 50 |
#: |
| 51 |
#: value is integer. |
| 52 |
class_attr = 42 |
| 53 |
|
| 54 |
def __init__(self): |
| 55 |
#: This is an instance attribute |
| 56 |
#: |
| 57 |
#: value is a string |
| 58 |
self.instance_attr = '42' |
| 59 |
|
| 60 |
def _prop_attr_get(self): |
| 61 |
"""This is a function docstring |
| 62 |
|
| 63 |
return value is string. |
| 64 |
""" |
| 65 |
return 'spam egg' |
| 66 |
|
| 67 |
prop_attr1 = property(_prop_attr_get) |
| 68 |
|
| 69 |
prop_attr2 = property(_prop_attr_get) |
| 70 |
""" |
| 71 |
This is a attribute docstring |
| 72 |
|
| 73 |
value is string. |
| 74 |
""" |
| 75 |
|
| 76 |
class C2: |
| 77 |
"""This is a nested inner class docstring""" |
| 78 |
|
| 79 |
|
| 80 |
def func(arg_, *args, **kwargs): |
| 81 |
"""Test function take an argument ended with underscore.""" |