From 44db94c154142f51349bf6ae513206b6345f00f7 Mon Sep 17 00:00:00 2001 From: palakkhinvasara Date: Thu, 16 Jul 2026 19:26:40 +0530 Subject: [PATCH 1/5] gh-: Remove obsolete 'condition list' from eval() docs --- Doc/library/functions.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index a4d37beb436899..14e908df20aa05 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -610,10 +610,9 @@ are always available. They are listed here in alphabetical order. This function executes arbitrary code. Calling it with untrusted user-supplied input will lead to security vulnerabilities. - The *source* argument is parsed and evaluated as a Python expression - (technically speaking, a condition list) using the *globals* and *locals* - mappings as global and local namespace. If the *globals* dictionary is - present and does not contain a value for the key ``__builtins__``, a +The *source* argument is parsed and evaluated as a Python expression +using the *globals* and *locals* mappings as global and local namespace +.If the *globals* dictionary is present and does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key before *source* is parsed. Overriding ``__builtins__`` can be used to restrict or change the available From 335b187385ab5441f151aec4d6d9f6de3437f345 Mon Sep 17 00:00:00 2001 From: palakkhinvasara Date: Thu, 16 Jul 2026 19:53:26 +0530 Subject: [PATCH 2/5] changes --- Doc/library/functions.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 14e908df20aa05..891a2386e03882 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -610,9 +610,10 @@ are always available. They are listed here in alphabetical order. This function executes arbitrary code. Calling it with untrusted user-supplied input will lead to security vulnerabilities. -The *source* argument is parsed and evaluated as a Python expression -using the *globals* and *locals* mappings as global and local namespace -.If the *globals* dictionary is present and does not contain a value for the key ``__builtins__``, a + The *source* argument is parsed and evaluated as a Python expression + using the *globals* and *locals* mappings as global and local namespace. + If the *globals* dictionary is present and does not contain a value for the + key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key before *source* is parsed. Overriding ``__builtins__`` can be used to restrict or change the available From 7dfca04fadacd19ef281e404667ef56d6e2183b4 Mon Sep 17 00:00:00 2001 From: palakkhinvasara Date: Fri, 17 Jul 2026 22:14:24 +0530 Subject: [PATCH 3/5] pushing changes --- Doc/library/functions.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 891a2386e03882..540c63b722477f 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -611,9 +611,9 @@ are always available. They are listed here in alphabetical order. untrusted user-supplied input will lead to security vulnerabilities. The *source* argument is parsed and evaluated as a Python expression - using the *globals* and *locals* mappings as global and local namespace. - If the *globals* dictionary is present and does not contain a value for the - key ``__builtins__``, a + (technically speaking, an :ref:`expression list `) , using + the *globals* and *locals* mappings as global and local namespace. If the *globals* + dictionary is present and does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key before *source* is parsed. Overriding ``__builtins__`` can be used to restrict or change the available @@ -633,6 +633,9 @@ are always available. They are listed here in alphabetical order. >>> eval('x+1') 2 + >>> eval("1, 2") + (1,2) + This function can also be used to execute arbitrary code objects (such as those created by :func:`compile`). In this case, pass a code object instead of a string. If the code object has been compiled with ``'exec'`` as the @@ -2380,4 +2383,4 @@ are always available. They are listed here in alphabetical order. .. [#] Note that the parser only accepts the Unix-style end of line convention. If you are reading the code from a file, make sure to use newline conversion - mode to convert Windows or Mac-style newlines. + mode to convert Windows or Mac-style newlines. \ No newline at end of file From 053e62f6bdf047cdce79f36574f260b2b6df4dcc Mon Sep 17 00:00:00 2001 From: palakkhinvasara Date: Fri, 17 Jul 2026 22:26:13 +0530 Subject: [PATCH 4/5] pushing changes --- Doc/library/functions.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 540c63b722477f..8024261e4688a0 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -2383,4 +2383,6 @@ are always available. They are listed here in alphabetical order. .. [#] Note that the parser only accepts the Unix-style end of line convention. If you are reading the code from a file, make sure to use newline conversion - mode to convert Windows or Mac-style newlines. \ No newline at end of file + mode to convert Windows or Mac-style newlines.ECHO is on. + +ECHO is on. From 627117bcab1be31eb554e41d19802c5fcb4038f4 Mon Sep 17 00:00:00 2001 From: palakkhinvasara Date: Fri, 17 Jul 2026 22:40:58 +0530 Subject: [PATCH 5/5] pushing --- Doc/library/functions.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 8024261e4688a0..8dbebf7048b583 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -611,9 +611,10 @@ are always available. They are listed here in alphabetical order. untrusted user-supplied input will lead to security vulnerabilities. The *source* argument is parsed and evaluated as a Python expression - (technically speaking, an :ref:`expression list `) , using - the *globals* and *locals* mappings as global and local namespace. If the *globals* - dictionary is present and does not contain a value for the key ``__builtins__``, a + (technically speaking, an :ref:`expression list `) + using the *globals* and *locals* mappings as global and local namespace. + If the *globals* dictionary is present and does not contain a value for the + key ``__builtins__``, a reference to the dictionary of the built-in module :mod:`builtins` is inserted under that key before *source* is parsed. Overriding ``__builtins__`` can be used to restrict or change the available @@ -634,7 +635,7 @@ are always available. They are listed here in alphabetical order. 2 >>> eval("1, 2") - (1,2) + (1, 2) This function can also be used to execute arbitrary code objects (such as those created by :func:`compile`). In this case, pass a code object instead @@ -2383,6 +2384,4 @@ are always available. They are listed here in alphabetical order. .. [#] Note that the parser only accepts the Unix-style end of line convention. If you are reading the code from a file, make sure to use newline conversion - mode to convert Windows or Mac-style newlines.ECHO is on. - -ECHO is on. + mode to convert Windows or Mac-style newlines.