@@ -50,7 +50,7 @@ msgstr "在这些生成的方法中使用的成员变量是使用 :pep:`526` 类
5050
5151#: ../../library/dataclasses.rst:34
5252msgid "will add, among other things, a :meth:`__init__` that looks like::"
53- msgstr ""
53+ msgstr "将在添加的内容中包括如下所示的 :meth:`__init__`:: "
5454
5555#: ../../library/dataclasses.rst:41
5656msgid ""
@@ -75,6 +75,9 @@ msgid ""
7575"<variable annotation>`. With two exceptions described below, nothing in "
7676":func:`dataclass` examines the type specified in the variable annotation."
7777msgstr ""
78+ ":func:`dataclass` 装饰器会检查类以查找 ``field``。 ``field`` 被定义为具有 :term:`类型标注 "
79+ "<variable annotation>` 的类变量。 除了下面描述的两个例外,在 :func:`dataclass` "
80+ "中没有什么东西会去检查在变量标注中所指定的类型。"
7881
7982#: ../../library/dataclasses.rst:60
8083msgid ""
@@ -90,6 +93,8 @@ msgid ""
9093"decorator returns the same class that it is called on; no new class is "
9194"created."
9295msgstr ""
96+ ":func:`dataclass` 装饰器将向类中添加各种“dunder”方法,如下所述。 "
97+ "如果所添加的方法已存在于类中,则行为将取决于下面所列出的参数。 装饰器会返回调用它的类本身;不会创建新的类。"
9398
9499#: ../../library/dataclasses.rst:69
95100msgid ""
@@ -268,6 +273,7 @@ msgid ""
268273" field with a default value. This is true whether this occurs in a single "
269274"class, or as a result of class inheritance."
270275msgstr ""
276+ "如果具有默认值的字段之后存在没有默认值的字段,将会引发 :exc:`TypeError`。 无论此情况是发生在单个类中还是作为类继承的结果,都是如此。"
271277
272278#: ../../library/dataclasses.rst:183
273279msgid ""
@@ -499,6 +505,8 @@ msgid ""
499505":exc:`TypeError`. If values in ``changes`` do not specify fields, raises "
500506":exc:`TypeError`."
501507msgstr ""
508+ "创建一个与 ``instance`` 的类型相同的新对象,用来自 ``changes`` 的值替换各个字段。 如果 ``instance`` "
509+ "不是数据类,则会引发 :exc:`TypeError`。 如果 ``changes`` 中的值没有指定字段,则会引发 :exc:`TypeError`。"
502510
503511#: ../../library/dataclasses.rst:369
504512msgid ""
0 commit comments