来自 docs :
A scope is a textual region of a Python program where a namespace is directly accessible. “Directly accessible” here means that an unqualified reference to a name attempts to find the name in the namespace.
为什么文档在定义“范围”时使用“直接”一词?它有什么意义吗?如果将“范围”定义为可访问命名空间的 Python 程序的文本区域,是否会有所不同?
最佳答案
始终可以通过限定引用来访问 namespace 。如果引用不需要限定,则可直接访问。
关于python - 为什么文档在定义 "directly"时使用单词 "scope"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66292544/