New submission from Jonathan Fine <jfine2...@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@python
components: Documentation
messages: 323716
nosy: docs@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue34431>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to