File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,6 +357,9 @@ msgid ""
357357"``__annotations__`` to any Python value, and will retain whatever value is "
358358"set."
359359msgstr ""
360+ "所有版本的 Python 3 中,均可将函数对象的 ``__annotations__`` 设为 ``None``。但后续用 "
361+ "``fn.__annotations__`` 访问该对象的注解时,会像本节第一段所述那样,直接创建一个空字典。但在任何 Python "
362+ "版本中,模块和类均非如此,他们允许将 ``__annotations__`` 设为任意 Python 值,并且会留存所设值。"
360363
361364#: ../../howto/annotations.rst:214
362365msgid ""
@@ -365,9 +368,11 @@ msgid ""
365368" will itself be quoted. In effect the annotation is quoted *twice.* For "
366369"example::"
367370msgstr ""
371+ "如果 Python 会对注解作字符串化处理(用 ``from __future__ import annotations`` "
372+ "),并且注解本身就是一个字符串,那么将会为其加上引号。实际效果就是,注解加了 *两次* 引号。例如:"
368373
369374#: ../../howto/annotations.rst:225
370375msgid ""
371376"This prints ``{'a': \" 'str'\" }``. This shouldn't really be considered a "
372377"\" quirk\" ; it's mentioned here simply because it might be surprising."
373- msgstr ""
378+ msgstr "这会打印出 ``{'a': \" 'str' \" }``。这不应算是个“坑”;只是因为可能会让人吃惊,所以才提一下。 "
You can’t perform that action at this time.
0 commit comments