Skip to content

Commit ef516d1

Browse files
bpo-32413: Add documentation that at the module level, locals(), globals() are the same dictionary (GH-5004)
https://bugs.python.org/issue32413 (cherry picked from commit 1c5fa5a) Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
1 parent 9a838c5 commit ef516d1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/functions.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,8 @@ are always available. They are listed here in alphabetical order.
842842

843843
Update and return a dictionary representing the current local symbol table.
844844
Free variables are returned by :func:`locals` when it is called in function
845-
blocks, but not in class blocks.
845+
blocks, but not in class blocks. Note that at the module level, :func:`locals`
846+
and :func:`globals` are the same dictionary.
846847

847848
.. note::
848849
The contents of this dictionary should not be modified; changes may not

0 commit comments

Comments
 (0)