New submission from Alon Mishne:

According to the documentation of eval():

> If the globals dictionary is present and lacks '__builtins__', the current 
> globals are copied into globals before expression is parsed.

However in practice only the __builtins__ items are copied, see:

http://hg.python.org/cpython/file/2.7/Python/bltinmodule.c#l655

See http://stackoverflow.com/q/24934908/242762

----------
assignee: docs@python
components: Documentation
messages: 223837
nosy: amishne, docs@python
priority: normal
severity: normal
status: open
title: The doc say all globals are copied on eval(), but only __builtins__ is 
copied
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

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

Reply via email to