8000 [3.12] Docs: Argument Clinic: Add Background and Tutorial top-level s… · python/cpython@1a3766b · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a3766b

Browse files
miss-islingtonerlend-aaslandezio-melotti
authored
[3.12] Docs: Argument Clinic: Add Background and Tutorial top-level sections (GH-106904) (#106945)
Docs: Argument Clinic: Add Background and Tutorial top-level sections (GH-106904) Add Background as a toplevel section with the following subsections: - Background - The goals of Argument Clinic - Basic concepts and usage Rename "Converting your first function" to Tutorial. Add anchors for Background, Tutorial, and How-to Guides: - :ref:`clinic-background` - :ref:`clinic-tutorial` - :ref:`clinic-howtos` Link to these from within the Abstract. Break the compatibility paragraph out of Abstract and make it a note. (cherry picked from commit 81861fd) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
1 parent 656f624 commit 1a3766b

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

Doc/howto/clinic.rst

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@ Argument Clinic How-To
1313

1414
Argument Clinic is a preprocessor for CPython C files.
1515
Its purpose is to automate all the boilerplate involved
16-
with writing argument parsing code for "builtins".
17-
This document shows you how to convert your first C
18-
function to work with Argument Clinic, and then introduces
19-
some advanced topics on Argument Clinic usage.
16+
with writing argument parsing code for "builtins",
17+
module level functions, and class methods.
18+
This document is divided in three major sections:
2019

21-
Currently Argument Clinic is considered internal-only
20+
* :ref:`clinic-background` talks about the basic concepts and goals of
21+
Argument Clinic.
22+
* :ref:`clinic-tutorial` guides you through all the steps required to
23+
adapt an existing C function to Argument Clinic.
24+
* :ref:`clinic-howtos` details how to handle specific tasks.
25+
26+
27+
.. note::
28+
29+
Argument Clinic is considered internal-only
2230
for CPython. Its use is not supported for files outside
2331
CPython, and no guarantees are made regarding backwards
2432
compatibility for future versions. In other words: if you
@@ -28,8 +36,14 @@ Argument Clinic How-To
2836
of CPython *could* be totally incompatible and break all your code.
2937

3038

39+
.. _clinic-background:
40+
41+
Background
42+
==========
43+
44+
3145
The goals of Argument Clinic
32-
============================
46+
----------------------------
3347

3448
Argument Clinic's primary goal
3549
is to take over responsibility for all argument parsing code
@@ -80,7 +94,7 @@ things with all the information you give it.
8094

8195

8296
Basic concepts and usage
83-
========================
97+
------------------------
8498

8599
Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic.py``.
86100
If you run that script, specifying a C file as an argument:
@@ -142,8 +156,10 @@ For the sake of clarity, here's the terminology we'll use with Argument Clinic:
142156
a block.)
143157

144158

145-
Converting your first function
146-
==============================
159+
.. _clinic-tutorial:
160+
161+
Tutorial
162+
========
147163

148164
The best way to get a sense of how Argument Clinic works is to
149165
convert a function to work with it. Here, then, are the bare
@@ -560,6 +576,8 @@ Let's dive in!
560576
Congratulations, you've ported your first function to work with Argument Clinic!
561577

562578

579+
.. _clinic-howtos:
580+
563581
How-to guides
564582
=============
565583

0 commit comments

Comments
 (0)
0