Skip to content

Commit 8c17729

Browse files
Docs: Normalize Argument Clinic How-To section capitalization (#106788)
1 parent d46a42f commit 8c17729

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

Doc/howto/clinic.rst

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Argument Clinic How-To
2727
version of Argument Clinic that ships with the next version
2828
of CPython *could* be totally incompatible and break all your code.
2929

30-
The Goals Of Argument Clinic
30+
31+
The goals of Argument Clinic
3132
============================
3233

3334
Argument Clinic's primary goal
@@ -78,7 +79,7 @@ and it should be able to do many interesting and smart
7879
things with all the information you give it.
7980

8081

81-
Basic Concepts And Usage
82+
Basic concepts and usage
8283
========================
8384

8485
Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic.py``.
@@ -141,7 +142,7 @@ For the sake of clarity, here's the terminology we'll use with Argument Clinic:
141142
a block.)
142143

143144

144-
Converting Your First Function
145+
Converting your first function
145146
==============================
146147

147148
The best way to get a sense of how Argument Clinic works is to
@@ -558,7 +559,8 @@ Let's dive in!
558559

559560
Congratulations, you've ported your first function to work with Argument Clinic!
560561

561-
Advanced Topics
562+
563+
Advanced topics
562564
===============
563565

564566
Now that you've had some experience working with Argument Clinic, it's time
@@ -636,7 +638,8 @@ after the last argument).
636638
Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this
637639
will change soon.
638640

639-
Optional Groups
641+
642+
Optional groups
640643
---------------
641644

642645
Some legacy functions have a tricky approach to parsing their arguments:
@@ -899,6 +902,7 @@ available. For each converter it'll show you all the parameters
899902
it accepts, along with the default value for each parameter.
900903
Just run ``Tools/clinic/clinic.py --converters`` to see the full list.
901904

905+
902906
Py_buffer
903907
---------
904908

@@ -908,7 +912,6 @@ you *must* not call :c:func:`PyBuffer_Release` on the provided buffer.
908912
Argument Clinic generates code that does it for you (in the parsing function).
909913

910914

911-
912915
Advanced converters
913916
-------------------
914917

@@ -975,6 +978,7 @@ value called ``NULL`` for just this reason: from Python's perspective it
975978
behaves like a default value of ``None``, but the C variable is initialized
976979
with ``NULL``.
977980

981+
978982
Expressions specified as default values
979983
---------------------------------------
980984

@@ -1032,7 +1036,6 @@ you're not permitted to use:
10321036
* Tuple/list/set/dict literals.
10331037

10341038

1035-
10361039
Using a return converter
10371040
------------------------
10381041

@@ -1146,6 +1149,7 @@ then modifying it. Cloning is an all-or nothing proposition.
11461149
Also, the function you are cloning from must have been previously defined
11471150
in the current file.
11481151

1152+
11491153
Calling Python code
11501154
-------------------
11511155

@@ -1380,6 +1384,7 @@ handle initialization and cleanup.
13801384
You can see more examples of custom converters in the CPython
13811385
source tree; grep the C files for the string ``CConverter``.
13821386

1387+
13831388
Writing a custom return converter
13841389
---------------------------------
13851390

@@ -1394,8 +1399,9 @@ write your own return converter, please read ``Tools/clinic/clinic.py``,
13941399
specifically the implementation of ``CReturnConverter`` and
13951400
all its subclasses.
13961401

1402+
13971403
METH_O and METH_NOARGS
1398-
----------------------------------------------
1404+
----------------------
13991405

14001406
To convert a function using ``METH_O``, make sure the function's
14011407
single argument is using the ``object`` converter, and mark the
@@ -1415,8 +1421,9 @@ any arguments.
14151421
You can still use a self converter, a return converter, and specify
14161422
a ``type`` argument to the object converter for ``METH_O``.
14171423

1424+
14181425
tp_new and tp_init functions
1419-
----------------------------------------------
1426+
----------------------------
14201427

14211428
You can convert ``tp_new`` and ``tp_init`` functions. Just name
14221429
them ``__new__`` or ``__init__`` as appropriate. Notes:
@@ -1437,6 +1444,7 @@ them ``__new__`` or ``__init__`` as appropriate. Notes:
14371444
(If your function doesn't support keywords, the parsing function
14381445
generated will throw an exception if it receives any.)
14391446

1447+
14401448
Changing and redirecting Clinic's output
14411449
----------------------------------------
14421450

@@ -1721,7 +1729,7 @@ the file was not modified by hand before it gets overwritten.
17211729

17221730

17231731
The #ifdef trick
1724-
----------------------------------------------
1732+
----------------
17251733

17261734
If you're converting a function that isn't available on all platforms,
17271735
there's a trick you can use to make life a little easier. The existing
@@ -1801,7 +1809,6 @@ Argument Clinic added to your file (it'll be at the very bottom), then
18011809
move it above the ``PyMethodDef`` structure where that macro is used.
18021810

18031811

1804-
18051812
Using Argument Clinic in Python files
18061813
-------------------------------------
18071814

0 commit comments

Comments
 (0)