[Python-checkins] bpo-19737: Improved the documentation for globals (GH-29823) (GH-30041)

ambv webhook-mailer at python.org
Fri Dec 10 19:32:29 EST 2021


https://github.com/python/cpython/commit/1f7000808e8385e2a29ffd0ef6aac9a6139d3d92
commit: 1f7000808e8385e2a29ffd0ef6aac9a6139d3d92
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2021-12-11T01:32:13+01:00
summary:

bpo-19737: Improved the documentation for globals (GH-29823) (GH-30041)

Co-authored-by: Alex Waygood <Alex.Waygood at Gmail.com>
Co-authored-by: Łukasz Langa <lukasz at langa.pl>
(cherry picked from commit 4fe5585240f64c3d14eb635ff82b163f92074b3a)

Co-authored-by: 180909 <734461790 at qq.com>

files:
A Misc/NEWS.d/next/Documentation/2021-11-28-22-43-21.bpo-19737.cOOubB.rst
M Doc/library/functions.rst

diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 307d67978559c..a117d30c0b0d5 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -733,9 +733,9 @@ are always available.  They are listed here in alphabetical order.
 
 .. function:: globals()
 
-   Return a dictionary representing the current global symbol table. This is always
-   the dictionary of the current module (inside a function or method, this is the
-   module where it is defined, not the module from which it is called).
+   Return the dictionary implementing the current module namespace. For code within
+   functions, this is set when the function is defined and remains the same
+   regardless of where the function is called.
 
 
 .. function:: hasattr(object, name)
diff --git a/Misc/NEWS.d/next/Documentation/2021-11-28-22-43-21.bpo-19737.cOOubB.rst b/Misc/NEWS.d/next/Documentation/2021-11-28-22-43-21.bpo-19737.cOOubB.rst
new file mode 100644
index 0000000000000..a3e16c9fdd0e6
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2021-11-28-22-43-21.bpo-19737.cOOubB.rst
@@ -0,0 +1 @@
+Update the documentation for the :func:`globals` function.



More information about the Python-checkins mailing list