python / python-docs-zh-cn

zh_CN translation of the Python documentation
https://docs.python.org/zh-cn/
431 stars 74 forks source link

[Typo]: 翻译不当 #321

Closed TernaryExplorer closed 1 year ago

TernaryExplorer commented 1 year ago

Python Version

3.11.4

Docs Page

https://docs.python.org/zh-cn/3/tutorial/classes.html

Original Translation

namespace (命名空间)是映射到对象的名称。现在,大多数命名空间都使用 Python 字典实现,但除非涉及到优化性能,我们一般不会关注这方面的事情,而且将来也可能会改变这种方式。命名空间的几个常见示例:abs() 函数、内置异常等的内置函数集合;模块中的全局名称;函数调用中的局部名称。对象的属性集合也算是一种命名空间。关于命名空间的一个重要知识点是,不同命名空间中的名称之间绝对没有关系;例如,两个不同的模块都可以定义 maximize 函数,且不会造成混淆。用户使用函数时必须要在函数名前面附加上模块名。

Original Docs Paragraph

A namespace is a mapping from names to objects. Most namespaces are currently implemented as Python dictionaries, but that’s normally not noticeable in any way (except for performance), and it may change in the future. Examples of namespaces are: the set of built-in names (containing functions such as abs(), and built-in exception names); the global names in a module; and the local names in a function invocation. In a sense the set of attributes of an object also form a namespace. The important thing to know about namespaces is that there is absolutely no relation between names in different namespaces; for instance, two different modules may both define a function maximize without confusion — users of the modules must prefix it with the module name.

Suggested Fix

该段第一句“A namespace is a mapping from names to objects.”似乎应当翻译为“namespace (命名空间)是名称到对象的映射。”而非“映射到对象的名称”

TernaryExplorer commented 1 year ago

好像已经有人提过了......