37
37
def foo (var1 , var2 , * args , long_var_name = "hi" , only_seldom_used_keyword = 0 , ** kwargs ):
38
38
r"""Summarize the function in one line.
39
39
40
+ .. warning:: Warning number 1
41
+
40
42
Several sentences providing an extended description. Refer to
41
43
variables using back-ticks, e.g. `var`.
42
44
45
+ .. warning::
46
+
47
+ A slightly longer, multiline warning.
48
+
49
+ Placed in the extended summary.
50
+
43
51
Parameters
44
52
----------
45
53
var1 : array_like
46
54
Array_like means all those objects -- lists, nested lists, etc. --
47
55
that can be converted to an array. We can also refer to
48
56
variables like `var1`.
57
+
58
+ .. warning::
59
+
60
+ An even richer warning in the parameter description that contains
61
+ a list:
62
+
63
+ - point 1
64
+ - point 2
65
+
66
+ and code::
67
+
68
+ a**2 + b**2 = c**2
69
+
49
70
var2 : int
50
71
The type above can either refer to an actual Python type
51
72
(e.g. ``int``), or describe the type of the variable in more
@@ -81,6 +102,8 @@ def foo(var1, var2, *args, long_var_name="hi", only_seldom_used_keyword=0, **kwa
81
102
BadException
82
103
Because you shouldn't have done that.
83
104
105
+ .. warning:: But seriously
106
+
84
107
See Also
85
108
--------
86
109
numpy.array : Relationship (optional).
@@ -94,6 +117,8 @@ def foo(var1, var2, *args, long_var_name="hi", only_seldom_used_keyword=0, **kwa
94
117
95
118
This can have multiple paragraphs.
96
119
120
+ .. warning:: A final warning, for good measure
121
+
97
122
You may include some math:
98
123
99
124
.. math:: X(e^{j\omega } ) = x(n)e^{ - j\omega n}
0 commit comments