diff options
author | Georg Brandl <georg@python.org> | 2007-12-02 09:40:06 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-12-02 09:40:06 (GMT) |
commit | 1a3284ed69d545e4ef59869998cb8c29233a45fa (patch) | |
tree | 98728a9b7aae6188ee8124160007a9d5c5277f8c /Doc/library | |
parent | 87f9c53937ce47f55851ac7c71a94e46cf9142bf (diff) | |
download | cpython-1a3284ed69d545e4ef59869998cb8c29233a45fa.zip cpython-1a3284ed69d545e4ef59869998cb8c29233a45fa.tar.gz cpython-1a3284ed69d545e4ef59869998cb8c29233a45fa.tar.bz2 |
#1535: rename __builtin__ module to builtins.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/builtins.rst (renamed from Doc/library/__builtin__.rst) | 12 | ||||
-rw-r--r-- | Doc/library/functions.rst | 4 | ||||
-rw-r--r-- | Doc/library/imputil.rst | 10 | ||||
-rw-r--r-- | Doc/library/python.rst | 2 | ||||
-rw-r--r-- | Doc/library/rlcompleter.rst | 2 | ||||
-rw-r--r-- | Doc/library/runpy.rst | 2 | ||||
-rw-r--r-- | Doc/library/sys.rst | 2 |
7 files changed, 17 insertions, 17 deletions
diff --git a/Doc/library/__builtin__.rst b/Doc/library/builtins.rst index b3e1e11..2a5c7f5 100644 --- a/Doc/library/__builtin__.rst +++ b/Doc/library/builtins.rst @@ -1,13 +1,13 @@ -:mod:`__builtin__` --- Built-in objects -======================================= +:mod:`builtins` --- Built-in objects +==================================== -.. module:: __builtin__ +.. module:: builtins :synopsis: The module that provides the built-in namespace. This module provides direct access to all 'built-in' identifiers of Python; for -example, ``__builtin__.open`` is the full name for the built-in function +example, ``builtins.open`` is the full name for the built-in function :func:`open`. See chapter :ref:`builtin`. This module is not normally accessed explicitly by most applications, but can be @@ -16,10 +16,10 @@ but in which the built-in of that name is also needed. For example, in a module that wants to implement an :func:`open` function that wraps the built-in :func:`open`, this module can be used directly:: - import __builtin__ + import builtins def open(path): - f = __builtin__.open(path, 'r') + f = builtins.open(path, 'r') return UpperCaser(f) class UpperCaser: diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 68601e5..5d0d8a5 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -356,7 +356,7 @@ available. They are listed here in alphabetical order. dictionaries as global and local namespace. If the *globals* dictionary is present and lacks '__builtins__', the current globals are copied into *globals* before *expression* is parsed. This means that *expression* normally has full - access to the standard :mod:`__builtin__` module and restricted environments are + access to the standard :mod:`builtins` module and restricted environments are propagated. If the *locals* dictionary is omitted it defaults to the *globals* dictionary. If both dictionaries are omitted, the expression is executed in the environment where :keyword:`eval` is called. The return value is the result of @@ -398,7 +398,7 @@ available. They are listed here in alphabetical order. If the *globals* dictionary does not contain a value for the key ``__builtins__``, a reference to the dictionary of the built-in module - :mod:`__builtin__` is inserted under that key. That way you can control what + :mod:`builtins` is inserted under that key. That way you can control what builtins are available to the executed code by inserting your own ``__builtins__`` dictionary into *globals* before passing it to :func:`exec`. diff --git a/Doc/library/imputil.rst b/Doc/library/imputil.rst index eff1cb9..c05ae1a 100644 --- a/Doc/library/imputil.rst +++ b/Doc/library/imputil.rst @@ -108,7 +108,7 @@ This code is intended to be read, not executed. However, it does work :: - import sys, imp, __builtin__ + import sys, imp, builtins # Replacement for __import__() def import_hook(name, globals=None, locals=None, fromlist=None): @@ -218,12 +218,12 @@ This code is intended to be read, not executed. However, it does work # Save the original hooks - original_import = __builtin__.__import__ - original_reload = __builtin__.reload + original_import = builtins.__import__ + original_reload = builtins.reload # Now install our hooks - __builtin__.__import__ = import_hook - __builtin__.reload = reload_hook + builtins.__import__ = import_hook + builtins.reload = reload_hook .. index:: module: knee diff --git a/Doc/library/python.rst b/Doc/library/python.rst index 3384322..0fdfa53 100644 --- a/Doc/library/python.rst +++ b/Doc/library/python.rst @@ -13,7 +13,7 @@ overview: .. toctree:: sys.rst - __builtin__.rst + builtins.rst __main__.rst warnings.rst contextlib.rst diff --git a/Doc/library/rlcompleter.rst b/Doc/library/rlcompleter.rst index 402a120..cec1e86 100644 --- a/Doc/library/rlcompleter.rst +++ b/Doc/library/rlcompleter.rst @@ -55,7 +55,7 @@ Completer objects have the following method: Return the *state*th completion for *text*. If called for *text* that doesn't include a period character (``'.'``), it will - complete from names currently defined in :mod:`__main__`, :mod:`__builtin__` and + complete from names currently defined in :mod:`__main__`, :mod:`builtins` and keywords (as defined by the :mod:`keyword` module). If called for a dotted name, it will try to evaluate anything without obvious diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst index d476879..2254906 100644 --- a/Doc/library/runpy.rst +++ b/Doc/library/runpy.rst @@ -46,7 +46,7 @@ The :mod:`runpy` module provides a single function: does not make filename information available, this variable is set to ``None``. ``__builtins__`` is automatically initialised with a reference to the top level - namespace of the :mod:`__builtin__` module. + namespace of the :mod:`builtins` module. If the argument *alter_sys* is supplied and evaluates to ``True``, then ``sys.argv[0]`` is updated with the value of ``__file__`` and diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 33de4f6..3b9112a 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -78,7 +78,7 @@ always available. .. function:: displayhook(value) If *value* is not ``None``, this function prints it to ``sys.stdout``, and saves - it in ``__builtin__._``. + it in ``builtins._``. ``sys.displayhook`` is called on the result of evaluating an expression entered in an interactive Python session. The display of these values can be customized |