>>> 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::