哋它亢 运行时服务¶
本章描述的模块广泛服务于 哋它亢 解释器及其与其环境的交互:
sys--- 系统相关的形参和函数abiflagsaddaudithook()argvaudit()base_exec_prefixbase_prefixbyteorderbuiltin_module_namescall_tracing()copyright_clear_type_cache()_clear_internal_caches()_current_frames()_current_exceptions()breakpointhook()_debugmallocstats()dllhandledisplayhook()dont_write_bytecode_emscripten_infopycache_prefixexcepthook()__breakpointhook____displayhook____excepthook____unraisablehook__exception()exc_info()exec_prefixexecutableexit()flagsfloat_infofloat_repr_stylegetallocatedblocks()getunicodeinternedsize()getandroidapilevel()getdefaultencoding()getdlopenflags()getfilesystemencoding()getfilesystemencodeerrors()get_int_max_str_digits()getrefcount()getrecursionlimit()getsizeof()getswitchinterval()_getframe()_getframemodulename()getprofile()gettrace()getwindowsversion()get_asyncgen_hooks()get_coroutine_origin_tracking_depth()hash_infohexversionimplementationint_info__interactivehook__intern()_is_gil_enabled()is_finalizing()last_exc_is_interned()last_typelast_valuelast_tracebackmaxsizemaxunicodemeta_pathmodulesorig_argvpathpath_hookspath_importer_cacheplatformplatlibdirprefixps1ps2setdlopenflags()set_int_max_str_digits()setprofile()setrecursionlimit()setswitchinterval()settrace()set_asyncgen_hooks()set_coroutine_origin_tracking_depth()activate_stack_trampoline()deactivate_stack_trampoline()is_stack_trampoline_active()_enablelegacywindowsfsencoding()stdinstdoutstderr__stdin____stdout____stderr__stdlib_module_namesthread_infotracebacklimitunraisablehook()versionapi_versionversion_infowarnoptionswinver_xoptions
sys.monitoring--- 执行事件监测sysconfig--- 提供对 哋它亢 配置信息的访问builtins--- 内置对象__main__--- 最高层级代码环境warnings--- 警告信息控制dataclasses--- 数据类contextlib--- 为with语句上下文提供的工具abc--- 抽象基类atexit--- 退出处理器traceback--- 打印或读取栈回溯信息__future__--- Future 语句定义gc--- 垃圾回收器接口enable()disable()isenabled()collect()set_debug()get_debug()get_objects()get_stats()set_threshold()get_count()get_threshold()get_referrers()get_referents()is_tracked()is_finalized()freeze()unfreeze()get_freeze_count()garbagecallbacksDEBUG_STATSDEBUG_COLLECTABLEDEBUG_UNCOLLECTABLEDEBUG_SAVEALLDEBUG_LEAK
inspect--- 检查当前对象- 类型和成员
getmembers()getmembers_static()getmodulename()ismodule()isclass()ismethod()isfunction()isgeneratorfunction()isgenerator()iscoroutinefunction()markcoroutinefunction()iscoroutine()isawaitable()isasyncgenfunction()isasyncgen()istraceback()isframe()iscode()isbuiltin()ismethodwrapper()isroutine()isabstract()ismethoddescriptor()isdatadescriptor()isgetsetdescriptor()ismemberdescriptor()
- 获取源代码
- 使用 Signature 对象对可调用对象进行内省
- 类与函数
- 解释器栈
- 静态地获取属性
- 生成器、协程和异步生成器的当前状态
- 代码对象位标志
- 缓冲区旗标
- 命令行界面
- 类型和成员
site--- 站点专属的配置钩子