From 4fe5585240f64c3d14eb635ff82b163f92074b3a Mon Sep 17 00:00:00 2001 From: 180909 <734461790@qq.com> Date: Sat, 11 Dec 2021 08:04:21 +0800 Subject: [PATCH] bpo-19737: Improved the documentation for globals (GH-29823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alex Waygood Co-authored-by: Ɓukasz Langa --- Doc/library/functions.rst | 6 +++--- .../Documentation/2021-11-28-22-43-21.bpo-19737.cOOubB.rst | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Documentation/2021-11-28-22-43-21.bpo-19737.cOOubB.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 0da2619685b..ebcd6c801d7 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 00000000000..a3e16c9fdd0 --- /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.