Python基于locals返回作用域字典

qq_35571 12 0 PDF 2020-12-17 08:12:06

英文文档: locals() Update and return a dictionary representing the current local symbol table. Free variables are returned by locals()when it is called in function blocks, but not in class blocks. 返回当前作用域内的局部变量和其值组成的字典 说明: 1. 函数功能返回当前作用域内的局部变量和其值组成的字典,与globals函数类似(返回全局变量) >>> locals() {'__package__

用户评论
请输入评论内容
评分:
暂无评论