bpo-22057: Clarify eval() documentation (GH-8812) · python/cpython@0e1e8db · GitHub
Skip to content

Commit 0e1e8db

Browse files
bpo-22057: Clarify eval() documentation (GH-8812)
If a globals dictionary without a '__builtins__' key is passed to eval(), a '__builtins__' key will be inserted to the dictionary: >>> eval("print('__builtins__' in globals())", {}) True (As a result of this behavior, we can use the builtins print() and globals() even if we passed a dictionary without a '__builtins__' key to eval().) (cherry picked from commit 225b055) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
1 parent 2e4ae8f commit 0e1e8db

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/library/functions.rst

Lines changed: 4 additions & 2 deletions

0 commit comments

Comments
 (0)