]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-141004: Document the `PyDoc_VAR` macro (GH-141263) (GH-141265)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 8 Nov 2025 18:20:56 +0000 (19:20 +0100)
committerGitHub <noreply@github.com>
Sat, 8 Nov 2025 18:20:56 +0000 (18:20 +0000)
gh-141004: Document the `PyDoc_VAR` macro (GH-141263)
(cherry picked from commit 545299773b40fb589cbd5e54d1d597207d9a2a76)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Doc/c-api/intro.rst

index 62ad5be7b8ac9f348c10b53e004f90d9c7e65eac..b4a0fa74ffe030c9bb542ca72e98db1fb4d51e2d 100644 (file)
@@ -247,7 +247,7 @@ complete listing.
 
 .. c:macro:: PyDoc_STRVAR(name, str)
 
-   Creates a variable with name ``name`` that can be used in docstrings.
+   Creates a variable with name *name* that can be used in docstrings.
    If Python is built without docstrings, the value will be empty.
 
    Use :c:macro:`PyDoc_STRVAR` for docstrings to support building
@@ -279,6 +279,15 @@ complete listing.
           {NULL, NULL}
       };
 
+.. c:macro:: PyDoc_VAR(name)
+
+   Declares a static character array variable with the given name *name*.
+
+   For example::
+
+      PyDoc_VAR(python_doc) = PyDoc_STR("A genus of constricting snakes in the Pythonidae family native "
+                                        "to the tropics and subtropics of the Eastern Hemisphere.");
+
 
 .. _api-objects: