New submission from Xavier Combelle:

According to my experiment in code, the current behavior of python3.5 is 
different that the document says. If I understand well the purpose of this 
behavior is to propagate the __builtins__ global constant if globals has not 
one.

In
https://docs.python.org/3.6/library/functions.html#eval

it is written  "If the globals dictionary is present and lacks ‘__builtins__’, 
the current globals are copied into globals before expression is parsed." only 
the __builtins__ looks copied not all the globals


In
https://docs.python.org/3.6/library/functions.html#exec
It is written:
"If the globals dictionary does not contain a value for the key __builtins__, a 
reference to the dictionary of the built-in module builtins is inserted under 
that key." it looks like it is not a reference to the built-in module builtin, 
but a reference to __builtin__ global

----------
title: builtins propagation is misleading described in exec and eval 
documentation -> __builtins__ propagation is misleading described in exec and 
eval documentation
versions: +Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26363>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to