@@ -613,10 +613,11 @@ are always available. They are listed here in alphabetical order.
613613 mappings as global and local namespace. If the *globals * dictionary is
614614 present and does not contain a value for the key ``__builtins__ ``, a
615615 reference to the dictionary of the built-in module :mod: `builtins ` is
616- inserted under that key before *source * is parsed. That way you can
617- control what builtins are available to the executed code by inserting your
618- own ``__builtins__ `` dictionary into *globals * before passing it to
619- :func: `eval `. If the *locals * mapping is omitted it defaults to the
616+ inserted under that key before *source * is parsed.
617+ Overriding ``__builtins__ `` can be used to restrict or change the available
618+ names, but it is **not ** a security mechanism, the executed code can
619+ still access builtins.
620+ If the *locals * mapping is omitted it defaults to the
620621 *globals * dictionary. If both mappings are omitted, the source is
621622 executed with the *globals * and *locals * in the environment where
622623 :func: `eval ` is called. Note, *eval() * will only have access to the
@@ -702,9 +703,10 @@ are always available. They are listed here in alphabetical order.
702703
703704 If the *globals * dictionary does not contain a value for the key
704705 ``__builtins__ ``, a reference to the dictionary of the built-in module
705- :mod: `builtins ` is inserted under that key. That way you can control what
706- builtins are available to the executed code by inserting your own
707- ``__builtins__ `` dictionary into *globals * before passing it to :func: `exec `.
706+ :mod: `builtins ` is inserted under that key.
707+ Overriding ``__builtins__ `` can be used to restrict or change the available
708+ names, but it is **not ** a security mechanism, the executed code can
709+ still access builtins.
708710
709711 The *closure * argument specifies a closure--a tuple of cellvars.
710712 It's only valid when the *object * is a code object containing
0 commit comments