[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().

https://docs.python.org/2/library/functions.html#locals

----------
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>
<https://bugs.python.org/issue32413>
_______________________________________


More information about the New-bugs-announce mailing list