@@ -1605,15 +1605,19 @@ \section{The {\tt dir()} function}
16051605
16061606{\tt dir()} does not list the names of built-in functions and variables.
16071607If you want a list of those, they are defined in the standard module
1608- {\tt builtin}:
1609-
1610- \bcode \begin {verbatim }
1611- >>> import builtin
1612- >>> dir(builtin)
1613- ['EOFError', 'KeyboardInterrupt', 'MemoryError', 'NameError', 'None', 'Runti
1614- meError', 'SystemError', 'TypeError', 'abs', 'chr', 'dir', 'divmod', 'eval',
1615- 'exec', 'float', 'input', 'int', 'len', 'long', 'max', 'min', 'open', 'ord'
1616- , 'pow', 'range', 'raw_input', 'reload', 'type']
1608+ {\tt __builtin__}:
1609+
1610+ \bcode \begin {verbatim }
1611+ >>> import __builtin__
1612+ >>> dir(__builtin__)
1613+ ['AccessError', 'AttributeError', 'ConflictError', 'EOFError', 'IOError', 'I
1614+ mportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', '
1615+ NameError', 'None', 'OverflowError', 'RuntimeError', 'SyntaxError', 'SystemE
1616+ rror', 'SystemExit', 'TypeError', 'ValueError', 'ZeroDivisionError', 'abs',
1617+ 'apply', 'chr', 'cmp', 'coerce', 'compile', 'dir', 'divmod', 'eval', 'execfi
1618+ le', 'float', 'getattr', 'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'le
1619+ n', 'long', 'max', 'min', 'oct', 'open', 'ord', 'pow', 'range', 'raw_input',
1620+ 'reload', 'repr', 'round', 'setattr', 'str', 'type']
16171621>>>
16181622\end {verbatim }\ecode
16191623
@@ -2083,8 +2087,7 @@ \section{Python scopes and name spaces}
20832087invocation of the interpreter, either read from a script file or
20842088interactively, are considered part of a module called \verb \__main__ \,
20852089so they have their own global name space. (The built-in names
2086- actually also live in a module; this is called \verb \builtin \,
2087- although it should really have been called \verb \__builtin__ \.)
2090+ actually also live in a module; this is called \verb \__builtin__ \.)
20882091
20892092The local name space for a function is created when the function is
20902093called, and deleted when the function returns or raises an exception
0 commit comments