[New-bugs-announce] [issue32413] Document that locals() may return globals()

Steven D'Aprano report at bugs.python.org
Sat Dec 23 00:52:42 EST 2017

New submission from Steven D'Aprano <steve+python at pearwood.info>:

The obvious documentation for locals() fails to mention that when called from the top level of a module (outside of a function or class body) it returns the same dict as globals().


assignee: docs at python
components: Documentation
messages: 308947
nosy: docs at python, steven.daprano
priority: normal
severity: normal
status: open
title: Document that locals() may return globals()
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list