From 9963bde0d51fcccf613a118dc6dc1f4d7a3ee38f Mon Sep 17 00:00:00 2001 From: Rajhans Jadhao Date: Mon, 10 Feb 2025 09:10:42 +0530 Subject: [PATCH 1/3] fix doc - use start symbol instead of start token --- Doc/c-api/veryhigh.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index 1ef4181d52eb10..94d796b4acc072 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -183,7 +183,7 @@ the same library that the Python runtime is using. objects *globals* and *locals* with the compiler flags specified by *flags*. *globals* must be a dictionary; *locals* can be any object that implements the mapping protocol. The parameter *start* specifies - the start token that should be used to parse the source code. + the start symbol that should be used to parse the source code. Returns the result of executing the code as a Python object, or ``NULL`` if an exception was raised. @@ -231,7 +231,7 @@ the same library that the Python runtime is using. .. c:function:: PyObject* Py_CompileStringObject(const char *str, PyObject *filename, int start, PyCompilerFlags *flags, int optimize) Parse and compile the Python source code in *str*, returning the resulting code - object. The start token is given by *start*; this can be used to constrain the + object. The start symbol is given by *start*; this can be used to constrain the code which can be compiled and should be :c:data:`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. The filename specified by *filename* is used to construct the code object and may appear in tracebacks or From e17b3c3bebfe288de0a991a48e8f2b0a74419475 Mon Sep 17 00:00:00 2001 From: Rajhans Jadhao Date: Tue, 13 May 2025 19:17:36 +0530 Subject: [PATCH 2/3] update link to Py_eval_input for reference --- Doc/c-api/veryhigh.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index 94d796b4acc072..af7c6a53f10bcc 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -183,7 +183,8 @@ the same library that the Python runtime is using. objects *globals* and *locals* with the compiler flags specified by *flags*. *globals* must be a dictionary; *locals* can be any object that implements the mapping protocol. The parameter *start* specifies - the start symbol that should be used to parse the source code. + the start symbol (e.g., :c:data:`Py_eval_input`) that should be used to + parse the source code. Returns the result of executing the code as a Python object, or ``NULL`` if an exception was raised. From 61babe0eb4062c3002459f859a1b2f140a015857 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Wed, 17 Sep 2025 15:42:11 +0100 Subject: [PATCH 3/3] Be explicit --- Doc/c-api/veryhigh.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index 24de1aff4247c5..ee0595a9e089c9 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -183,8 +183,8 @@ the same library that the Python runtime is using. objects *globals* and *locals* with the compiler flags specified by *flags*. *globals* must be a dictionary; *locals* can be any object that implements the mapping protocol. The parameter *start* specifies - the start symbol (e.g., :c:data:`Py_eval_input`) that should be used to - parse the source code. + the start symbol and must one of the following: + :c:data:`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. Returns the result of executing the code as a Python object, or ``NULL`` if an exception was raised.