Skip to content

Commit 3d3b189

Browse files
authored
[3.6] bpo-30372: Clarify that '__builtins__' is a CPython Implementation detail (GH-1725) (GH-1727)
(cherry picked from commit 43c8a9e)
1 parent 54af41d commit 3d3b189

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Doc/reference/executionmodel.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,22 @@ Builtins and restricted execution
164164

165165
.. index:: pair: restricted; execution
166166

167-
The builtins namespace associated with the execution of a code block is actually
168-
found by looking up the name ``__builtins__`` in its global namespace; this
169-
should be a dictionary or a module (in the latter case the module's dictionary
170-
is used). By default, when in the :mod:`__main__` module, ``__builtins__`` is
171-
the built-in module :mod:`builtins`; when in any other module,
172-
``__builtins__`` is an alias for the dictionary of the :mod:`builtins` module
173-
itself. ``__builtins__`` can be set to a user-created dictionary to create a
174-
weak form of restricted execution.
175-
176167
.. impl-detail::
177168

178169
Users should not touch ``__builtins__``; it is strictly an implementation
179170
detail. Users wanting to override values in the builtins namespace should
180171
:keyword:`import` the :mod:`builtins` module and modify its
181172
attributes appropriately.
182173

174+
The builtins namespace associated with the execution of a code block
175+
is actually found by looking up the name ``__builtins__`` in its
176+
global namespace; this should be a dictionary or a module (in the
177+
latter case the module's dictionary is used). By default, when in the
178+
:mod:`__main__` module, ``__builtins__`` is the built-in module
179+
:mod:`builtins`; when in any other module, ``__builtins__`` is an
180+
alias for the dictionary of the :mod:`builtins` module itself.
181+
182+
183183
.. _dynamic-features:
184184

185185
Interaction with dynamic features

0 commit comments

Comments
 (0)