[docs] [issue34431] Docs does not eval allows code object as argument

Jonathan Fine report at bugs.python.org
Sat Aug 18 12:03:19 EDT 2018


New submission from Jonathan Fine <jfine2358 at gmail.com>:

See https://docs.python.org/3.6/library/functions.html#eval
This says the following won't happen. But it does.

Python 3.6.2 (default, Jul 29 2017, 00:00:00) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def fn(): print(3); return 4
... 
>>> eval(fn.__code__)
3
4

Compare with https://docs.python.org/3.6/library/functions.html#exec

Search for eval in title of open issues bring up related

#22057 (The doc say all globals are copied on eval(), but only __builtins__ is copied)
#25810 (Python 3 documentation for eval is incorrect)

----------
assignee: docs at python
components: Documentation
messages: 323716
nosy: docs at python, jfine2358
priority: normal
severity: normal
status: open
title: Docs does not eval allows code object as argument
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34431>
_______________________________________


More information about the docs mailing list