]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141004: Document the `PyDoc_VAR` macro (GH-141263)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Sat, 8 Nov 2025 18:12:03 +0000 (18:12 +0000)
committerGitHub <noreply@github.com>
Sat, 8 Nov 2025 18:12:03 +0000 (13:12 -0500)
Doc/c-api/intro.rst

index acce3dc215d1573f3b674079f5ba550501826a67..4e7d1630ab3da684c2a2c3acb47a48b784c83486 100644 (file)
@@ -235,7 +235,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
@@ -267,6 +267,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: