@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version : Python 3.11\n "
1313"Report-Msgid-Bugs-To : \n "
14- "POT-Creation-Date : 2024-02-23 16:44 +0000\n "
14+ "POT-Creation-Date : 2024-02-25 02:11 +0000\n "
1515"PO-Revision-Date : 2023-05-24 02:14+0000\n "
1616"
Last-Translator :
Rafael Fontenelle <[email protected] >, 2024\n "
1717"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -608,8 +608,8 @@ msgid ""
608608":exc:`TypeError`. If values in ``changes`` do not specify fields, raises "
609609":exc:`TypeError`."
610610msgstr ""
611- "创建一个与 ``obj`` 类型相同的新对象,将字段替换为 ``changes`` 里的值。如果 ``obj`` 不是数据类,引发 "
612- ":exc:`TypeError` 。如果 ``changes`` 里的值没有指定要替换的字段名,引发 :exc:`TypeError`。"
611+ "创建一个与 ``obj`` 类型相同的新对象,将字段替换为 ``changes`` 里的值。如果 ``obj`` 不是数据类,则抛出 "
612+ ":exc:`TypeError` 。如果 ``changes`` 里的值没有指定要替换的字段名,则抛出 :exc:`TypeError`。"
613613
614614#: ../../library/dataclasses.rst:432
615615msgid ""
@@ -629,7 +629,8 @@ msgstr ""
629629msgid ""
630630"It is an error for ``changes`` to contain any fields that are defined as "
631631"having ``init=False``. A :exc:`ValueError` will be raised in this case."
632- msgstr "``changes`` 试图为任何定义为 ``init=False`` 的字段赋值,会引发 :exc:`ValueError`。"
632+ msgstr ""
633+ "``changes`` 包含任何定义为 ``init=False`` 的字段是错误的。在这种情况下会引发 :exc:`ValueError` 。"
633634
634635#: ../../library/dataclasses.rst:444
635636msgid ""
@@ -970,7 +971,7 @@ msgstr ""
970971
971972#: ../../library/dataclasses.rst:755
972973msgid "Descriptor-typed fields"
973- msgstr "字段标注描述器类型 "
974+ msgstr "描述器类型的字段 "
974975
975976#: ../../library/dataclasses.rst:757
976977msgid ""
@@ -1002,13 +1003,13 @@ msgid ""
10021003"hand, if the descriptor raises :exc:`AttributeError` in this situation, no "
10031004"default value will be provided for the field."
10041005msgstr ""
1005- "检测一个字段是否存在默认值时 ,``dataclasses`` 将使用类方法(即``descriptor.__get__(obj=None, "
1006- "type=cls)`` )调用描述器的``__get__`` 方法。 在这种情况下,如果描述器拥有返回值 "
1006+ "检测一个字段是否存在默认值时 ,``dataclasses`` 将使用类方法(即 ``descriptor.__get__(obj=None, "
1007+ "type=cls)`` )调用描述器的 ``__get__`` 方法。 在这种情况下,如果描述器拥有返回值 "
10071008",则返回值为该字段的默认值。如果在这种情况下描述器抛出 :exc:`AttributeError` 错误,则该字段不存在默认值。"
10081009
10091010#: ../../library/dataclasses.rst:801
10101011msgid ""
10111012"Note that if a field is annotated with a descriptor type, but is not "
10121013"assigned a descriptor object as its default value, the field will act like a"
10131014" normal field."
1014- msgstr "若一个字段被标注为描述器类型 ,但其默认值并不是描述器对象,那么该字段的效果只会像普通的字段一样 。"
1015+ msgstr "若一个字段的类型是描述器 ,但其默认值并不是描述器对象,那么该字段只会像普通的字段一样工作 。"
0 commit comments