From: Ezio Melotti Date: Sat, 17 Nov 2012 10:56:29 +0000 (+0200) Subject: Merge updates about dir() with 3.3. X-Git-Tag: v3.4.0a1~1997 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac6ca3dc021d80ae3d4075fd6f4d27942484f743;p=thirdparty%2FPython%2Fcpython.git Merge updates about dir() with 3.3. --- ac6ca3dc021d80ae3d4075fd6f4d27942484f743 diff --cc Doc/tutorial/modules.rst index 15b80943850d,c4d86ac31f6c..3a3283dc65f4 --- a/Doc/tutorial/modules.rst +++ b/Doc/tutorial/modules.rst @@@ -288,17 -288,25 +288,24 @@@ defines. It returns a sorted list of s >>> import fibo, sys >>> dir(fibo) ['__name__', 'fib', 'fib2'] - >>> dir(sys) - ['__displayhook__', '__doc__', '__excepthook__', '__name__', '__stderr__', - '__stdin__', '__stdout__', '_getframe', 'api_version', 'argv', - 'builtin_module_names', 'byteorder', 'callstats', 'copyright', - 'displayhook', 'exc_info', 'excepthook', - 'exec_prefix', 'executable', 'exit', 'getdefaultencoding', 'getdlopenflags', - 'getrecursionlimit', 'getrefcount', 'hexversion', 'maxint', 'maxunicode', - 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', - 'platform', 'prefix', 'ps1', 'ps2', 'setcheckinterval', 'setdlopenflags', - 'setprofile', 'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout', - 'version', 'version_info', 'warnoptions'] + >>> dir(sys) # doctest: +NORMALIZE_WHITESPACE - ['__displayhook__', '__doc__', '__egginsert', '__excepthook__', - '__loader__', '__name__', '__package__', '__plen', '__stderr__', - '__stdin__', '__stdout__', '_clear_type_cache', '_current_frames', - '_debugmallocstats', '_getframe', '_home', '_mercurial', '_xoptions', - 'abiflags', 'api_version', 'argv', 'base_exec_prefix', 'base_prefix', - 'builtin_module_names', 'byteorder', 'call_tracing', 'callstats', - 'copyright', 'displayhook', 'dont_write_bytecode', 'exc_info', - 'excepthook', 'exec_prefix', 'executable', 'exit', 'flags', 'float_info', - 'float_repr_style', 'getcheckinterval', 'getdefaultencoding', - 'getdlopenflags', 'getfilesystemencoding', 'getobjects', 'getprofile', - 'getrecursionlimit', 'getrefcount', 'getsizeof', 'getswitchinterval', - 'gettotalrefcount', 'gettrace', 'hash_info', 'hexversion', - 'implementation', 'int_info', 'intern', 'maxsize', 'maxunicode', - 'meta_path', 'modules', 'path', 'path_hooks', 'path_importer_cache', - 'platform', 'prefix', 'ps1', 'setcheckinterval', 'setdlopenflags', - 'setprofile', 'setrecursionlimit', 'setswitchinterval', 'settrace', - 'stderr', 'stdin', 'stdout', 'thread_info', 'version', 'version_info', - 'warnoptions'] ++ ['__displayhook__', '__doc__', '__excepthook__', '__loader__', '__name__', ++ '__package__', '__stderr__', '__stdin__', '__stdout__', ++ '_clear_type_cache', '_current_frames', '_debugmallocstats', '_getframe', ++ '_home', '_mercurial', '_xoptions', 'abiflags', 'api_version', 'argv', ++ 'base_exec_prefix', 'base_prefix', 'builtin_module_names', 'byteorder', ++ 'call_tracing', 'callstats', 'copyright', 'displayhook', ++ 'dont_write_bytecode', 'exc_info', 'excepthook', 'exec_prefix', ++ 'executable', 'exit', 'flags', 'float_info', 'float_repr_style', ++ 'getcheckinterval', 'getdefaultencoding', 'getdlopenflags', ++ 'getfilesystemencoding', 'getobjects', 'getprofile', 'getrecursionlimit', ++ 'getrefcount', 'getsizeof', 'getswitchinterval', 'gettotalrefcount', ++ 'gettrace', 'hash_info', 'hexversion', 'implementation', 'int_info', ++ 'intern', 'maxsize', 'maxunicode', 'meta_path', 'modules', 'path', ++ 'path_hooks', 'path_importer_cache', 'platform', 'prefix', 'ps1', ++ 'setcheckinterval', 'setdlopenflags', 'setprofile', 'setrecursionlimit', ++ 'setswitchinterval', 'settrace', 'stderr', 'stdin', 'stdout', ++ 'thread_info', 'version', 'version_info', 'warnoptions'] Without arguments, :func:`dir` lists the names you have defined currently::