]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-19737: Improved the documentation for globals (GH-29823)
author180909 <734461790@qq.com>
Sat, 11 Dec 2021 00:04:21 +0000 (08:04 +0800)
committerGitHub <noreply@github.com>
Sat, 11 Dec 2021 00:04:21 +0000 (01:04 +0100)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Doc/library/functions.rst
Misc/NEWS.d/next/Documentation/2021-11-28-22-43-21.bpo-19737.cOOubB.rst [new file with mode: 0644]

index 0da2619685bff649ae9986ffdefa9857e2a7a07d..ebcd6c801d70e4d1b75b2f851af6d21dadc564dd 100644 (file)
@@ -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 (file)
index 0000000..a3e16c9
--- /dev/null
@@ -0,0 +1 @@
+Update the documentation for the :func:`globals` function.