[New-bugs-announce] [issue19737] Documentation of globals() and locals() should be improved

Zahari Dim report at bugs.python.org
Sat Nov 23 17:51:01 CET 2013


New submission from Zahari Dim:

The globals() notification states:

Return a dictionary representing the current global symbol table.[...]

This doc and the fact that globals() is called as a function made me think that globals() returns a copy of the global namespace dict, rather than an object that could be used to actually modify the namespace. I don't find obvious the meaning of "representing" in this context.

This of course led to a very nasty and sneaky bug in my code.

The docs of locals() don't seem clear to me either, thought at least it seems to imply that it is actually modifying the namespace.

----------
assignee: docs at python
components: Documentation
messages: 204052
nosy: Zahari.Dim, docs at python
priority: normal
severity: normal
status: open
title: Documentation of globals() and locals() should be improved

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19737>
_______________________________________


More information about the New-bugs-announce mailing list