[issue32413] Document that locals() may return globals()

2019-04-02 Thread Brett Cannon


Change by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2019-04-02 Thread miss-islington


miss-islington  added the comment:


New changeset ef516d11c1a0f885dba0aba8cf5366502077cdd4 by Miss Islington (bot) 
in branch '3.7':
bpo-32413: Add documentation that at the module level, locals(), globals() are 
the  same dictionary (GH-5004)
https://github.com/python/cpython/commit/ef516d11c1a0f885dba0aba8cf5366502077cdd4


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2019-04-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12592

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2019-04-01 Thread Brett Cannon


Change by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2018-01-02 Thread Martin Panter

Martin Panter  added the comment:

FWIW a few years ago I wrote a patch for Issue 17546 that documents three 
personalities of “locals”, including:

* At the module level, the dictionary returned is the global symbol table, also 
returned by :func:`globals`.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2017-12-24 Thread Srinivas Reddy T

Srinivas  Reddy T  added the comment:

Done. exec(...)'s  documentation covers raymond's comment.

--
nosy: +thatiparthy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2017-12-24 Thread Srinivas Reddy T

Change by Srinivas  Reddy T :


--
keywords: +patch
pull_requests: +4893
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2017-12-23 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

FWIW, this isn't a quirk of how locals() works.  Instead, it reflects the more 
interesting reality that at the top level, locals and globals *are* the same 
dictionary.   Also, that is not the only occurrence -- if exec() is called with 
only one dictionary, that dict is used for both locals and globals.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2017-12-23 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2017-12-22 Thread Steven D'Aprano

New submission from Steven D'Aprano :

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@python
components: Documentation
messages: 308947
nosy: docs@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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com