Skip to content

Commit 5dd0973

Browse files
committed
Flatten things down.
1 parent 856a441 commit 5dd0973

File tree

1 file changed

+13
-41
lines changed

1 file changed

+13
-41
lines changed

Doc/c-api/function.rst

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,11 @@ There are a few functions specific to Python functions.
5757
Return the code object associated with the function object *op*.
5858
5959
60-
.. c:function:: PyObject *PyFunction_GET_CODE(PyObject *op)
61-
62-
Similar to :c:func:`PyFunction_GetCode`, but without error checking.
63-
64-
6560
.. c:function:: PyObject* PyFunction_GetGlobals(PyObject *op)
6661
6762
Return the globals dictionary associated with the function object *op*.
6863
6964
70-
.. c:function:: PyObject *PyFunction_GET_GLOBALS(PyObject *op)
71-
72-
Similar to :c:func:`PyFunction_GetGlobals`, but without error checking.
73-
74-
7565
.. c:function:: PyObject* PyFunction_GetModule(PyObject *op)
7666
7767
Return a :term:`borrowed reference` to the :attr:`~function.__module__`
@@ -82,22 +72,12 @@ There are a few functions specific to Python functions.
8272
but can be set to any other object by Python code.
8373
8474
85-
.. c:function:: PyObject *PyFunction_GET_MODULE(PyObject *op)
86-
87-
Similar to :c:func:`PyFunction_GetModule`, but without error checking.
88-
89-
9075
.. c:function:: PyObject* PyFunction_GetDefaults(PyObject *op)
9176
9277
Return the argument default values of the function object *op*. This can be a
9378
tuple of arguments or ``NULL``.
9479
9580
96-
.. c:function:: PyObject *PyFunction_GET_DEFAULTS(PyObject *op)
97-
98-
Similar to :c:func:`PyFunction_GetDefaults`, but without error checking.
99-
100-
10181
.. c:function:: int PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
10282
10383
Set the argument default values for the function object *op*. *defaults* must be
@@ -121,27 +101,13 @@ There are a few functions specific to Python functions.
121101
Return the keyword-only argument default values of the function object *op*. This can be a
122102
dictionary of arguments or ``NULL``.
123103
124-
.. versionadded:: 3.0
125-
126-
127-
.. c:function:: PyObject *PyFunction_GET_KW_DEFAULTS(PyObject *op)
128-
129-
Similar to :c:func:`PyFunction_GetKwDefaults`, but without error checking.
130-
131-
.. versionadded:: 3.0
132-
133104
134105
.. c:function:: PyObject* PyFunction_GetClosure(PyObject *op)
135106
136107
Return the closure associated with the function object *op*. This can be ``NULL``
137108
or a tuple of cell objects.
138109
139110
140-
.. c:function:: PyObject *PyFunction_GET_CLOSURE(PyObject *op)
141-
142-
Similar to :c:func:`PyFunction_GetClosure`, but without error checking.
143-
144-
145111
.. c:function:: int PyFunction_SetClosure(PyObject *op, PyObject *closure)
146112
147113
Set the closure associated with the function object *op*. *closure* must be
@@ -158,13 +124,6 @@ There are a few functions specific to Python functions.
158124
.. versionadded:: 3.0
159125
160126
161-
.. c:function:: PyObject *PyFunction_GET_ANNOTATIONS(PyObject *op)
162-
163-
Similar to :c:func:`PyFunction_GetAnnotations`, but without error checking.
164-
165-
.. versionadded:: 3.0
166-
167-
168127
.. c:function:: int PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
169128
170129
Set the annotations for the function object *op*. *annotations*
@@ -175,6 +134,19 @@ There are a few functions specific to Python functions.
175134
.. versionadded:: 3.0
176135
177136
137+
.. c:function:: PyObject *PyFunction_GET_CODE(PyObject *op)
138+
PyObject *PyFunction_GET_GLOBALS(PyObject *op)
139+
PyObject *PyFunction_GET_MODULE(PyObject *op)
140+
PyObject *PyFunction_GET_DEFAULTS(PyObject *op)
141+
PyObject *PyFunction_GET_KW_DEFAULTS(PyObject *op)
142+
PyObject *PyFunction_GET_CLOSURE(PyObject *op)
143+
PyObject *PyFunction_GET_ANNOTATIONS(PyObject *op)
144+
145+
Similar to their ``PyFunction_Get*`` counterparts, but do not do type
146+
checking. Passing anything other than an instance of
147+
:c:type:`PyFunction_type` is undefined behavior.
148+
149+
178150
.. c:function:: int PyFunction_AddWatcher(PyFunction_WatchCallback callback)
179151
180152
Register *callback* as a function watcher for the current interpreter.

0 commit comments

Comments
 (0)