mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#1535: rename __builtin__ module to builtins.
This commit is contained in:
parent
87f9c53937
commit
1a3284ed69
70 changed files with 246 additions and 247 deletions
|
@ -98,7 +98,7 @@ until the interpreter quits. The statements executed by the top-level
|
|||
invocation of the interpreter, either read from a script file or interactively,
|
||||
are considered part of a module called :mod:`__main__`, so they have their own
|
||||
global namespace. (The built-in names actually also live in a module; this is
|
||||
called :mod:`__builtin__`.)
|
||||
called :mod:`builtins`.)
|
||||
|
||||
The local namespace for a function is created when the function is called, and
|
||||
deleted when the function returns or raises an exception that is not handled
|
||||
|
|
|
@ -308,14 +308,14 @@ Without arguments, :func:`dir` lists the names you have defined currently::
|
|||
|
||||
Note that it lists all types of names: variables, modules, functions, etc.
|
||||
|
||||
.. index:: module: __builtin__
|
||||
.. index:: module: builtins
|
||||
|
||||
:func:`dir` does not list the names of built-in functions and variables. If you
|
||||
want a list of those, they are defined in the standard module
|
||||
:mod:`__builtin__`::
|
||||
:mod:`builtins`::
|
||||
|
||||
>>> import __builtin__
|
||||
>>> dir(__builtin__)
|
||||
>>> import builtins
|
||||
>>> dir(builtins)
|
||||
|
||||
['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'Buffer
|
||||
Error', 'DeprecationWarning', 'EOFError', 'Ellipsis', 'EnvironmentError', 'Excep
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue