[issue22057] The doc say all globals are copied on eval(), but only __builtins__ is copied

2014-07-24 Thread Alon Mishne

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 
<http://bugs.python.org/issue22057>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22057] The doc say all globals are copied on eval(), but only __builtins__ is copied

2014-07-27 Thread Alon Mishne

Alon Mishne added the comment:

Patch for 2.7.8.

The patch is just changing "globals are" to "mapping of ‘__builtins__’ is", and 
subsequent paragraph reformatting.

--
keywords: +patch
Added file: http://bugs.python.org/file36128/evalglobals2.patch

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



[issue22057] The doc say all globals are copied on eval(), but only __builtins__ is copied

2014-07-27 Thread Alon Mishne

Alon Mishne added the comment:

Patch for 3.5.x

The patch is just changing "globals are" to "mapping of ‘__builtins__’ is", and 
subsequent paragraph reformatting.

Nearly identical to 2.7.8 patch.

--
Added file: http://bugs.python.org/file36129/evalglobals3.patch

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