Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 65b730e

Browse files
[po] auto sync
1 parent 9fb4032 commit 65b730e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

howto/annotations.po

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ msgid ""
357357
"``__annotations__`` to any Python value, and will retain whatever value is "
358358
"set."
359359
msgstr ""
360+
"所有版本的 Python 3 中,均可将函数对象的 ``__annotations__`` 设为 ``None``。但后续用 "
361+
"``fn.__annotations__`` 访问该对象的注解时,会像本节第一段所述那样,直接创建一个空字典。但在任何 Python "
362+
"版本中,模块和类均非如此,他们允许将 ``__annotations__`` 设为任意 Python 值,并且会留存所设值。"
360363

361364
#: ../../howto/annotations.rst:214
362365
msgid ""
@@ -365,9 +368,11 @@ msgid ""
365368
" will itself be quoted. In effect the annotation is quoted *twice.* For "
366369
"example::"
367370
msgstr ""
371+
"如果 Python 会对注解作字符串化处理(用 ``from __future__ import annotations`` "
372+
"),并且注解本身就是一个字符串,那么将会为其加上引号。实际效果就是,注解加了 *两次* 引号。例如:"
368373

369374
#: ../../howto/annotations.rst:225
370375
msgid ""
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'\"}``。这不应算是个“坑”;只是因为可能会让人吃惊,所以才提一下。"

0 commit comments

Comments
 (0)