@@ -15,7 +15,7 @@ msgid ""
1515msgstr ""
1616"Project-Id-Version : Python 3.12\n "
1717"Report-Msgid-Bugs-To : \n "
18- "POT-Creation-Date : 2023-07-28 14:13+0000\n "
18+ "POT-Creation-Date : 2023-08-11 14:13+0000\n "
1919"PO-Revision-Date : 2021-06-28 00:50+0000\n "
2020"
Last-Translator :
Freesand Leo <[email protected] >, 2023\n "
2121"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -81,13 +81,17 @@ msgid ""
8181"accessing :c:member:`~PyTypeObject.tp_dict` directly. The returned "
8282"dictionary must be treated as read-only."
8383msgstr ""
84+ "返回类型对象的内部命名空间,它在其他情况下只能通过只读代理 (``cls.__dict__``) 公开。 这可以代替直接访问 "
85+ ":c:member:`~PyTypeObject.tp_dict` 的方式。 返回的字典必须当作是只读的。"
8486
8587#: ../../c-api/type.rst:60
8688msgid ""
8789"This function is meant for specific embedding and language-binding cases, "
8890"where direct access to the dict is necessary and indirect access (e.g. via "
8991"the proxy or :c:func:`PyObject_GetAttr`) isn't adequate."
9092msgstr ""
93+ "该函数用于特定的嵌入和语言绑定场景,在这些场景下需要直接访问该字典而间接访问(例如通过代理或 :c:func:`PyObject_GetAttr` "
94+ "访问)并不足够。"
9195
9296#: ../../c-api/type.rst:64
9397msgid ""
@@ -118,13 +122,17 @@ msgid ""
118122":c:func:`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g."
119123" if *watcher_id* was never registered.)"
120124msgstr ""
125+ "清除由 *watcher_id* (之前从 :c:func:`PyType_AddWatcher` 返回) 所标识的 watcher。 成功时返回 "
126+ "``0``,出错时(例如 *watcher_id* 未被注册)返回 ``-1``。"
121127
122128#: ../../c-api/type.rst:93
123129msgid ""
124130"An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* "
125131"that was not returned to it by a previous call to "
126132":c:func:`PyType_AddWatcher`."
127133msgstr ""
134+ "扩展在调用 ``PyType_ClearWatcher`` 时绝不能使用不是之前调用 :c:func:`PyType_AddWatcher` 所返回的 "
135+ "*watcher_id*。"
128136
129137#: ../../c-api/type.rst:102
130138msgid ""
@@ -135,23 +143,30 @@ msgid ""
135143":c:func:`!_PyType_Lookup` is not called on *type* between the modifications;"
136144" this is an implementation detail and subject to change.)"
137145msgstr ""
146+ "将 *type* 标记为已监视。 每当 :c:func:`PyType_Modified` 报告 *type* 发生变化时 "
147+ ":c:func:`PyType_AddWatcher` 赋予 *watcher_id* 的回调将被调用。 (如果在 *type* "
148+ "的一系列连续修改之间没有调用 :c:func:`!_PyType_Lookup`,则回调只能被调用一次;这是一个实现细节并可能发生变化)。"
138149
139150#: ../../c-api/type.rst:109
140151msgid ""
141152"An extension should never call ``PyType_Watch`` with a *watcher_id* that was"
142153" not returned to it by a previous call to :c:func:`PyType_AddWatcher`."
143154msgstr ""
155+ "扩展在调用 ``PyType_Watch`` 时绝不能使用不是之前调用 :c:func:`PyType_AddWatcher` 所返回的 "
156+ "*watcher_id*。"
144157
145158#: ../../c-api/type.rst:117
146159msgid "Type of a type-watcher callback function."
147- msgstr ""
160+ msgstr "类型监视器回调函数的类型。 "
148161
149162#: ../../c-api/type.rst:119
150163msgid ""
151164"The callback must not modify *type* or cause :c:func:`PyType_Modified` to be"
152165" called on *type* or any type in its MRO; violating this rule could cause "
153166"infinite recursion."
154167msgstr ""
168+ "回调不可以修改 *type* 或是导致 :c:func:`PyType_Modified` 在 *type* 或其 MRO "
169+ "中的任何类型上被调用;违反此规则可能导致无限递归。"
155170
156171#: ../../c-api/type.rst:128
157172msgid ""
@@ -163,7 +178,7 @@ msgstr "如果类型对象 *o* 设置了特性 *feature* 则返回非零值。
163178msgid ""
164179"Return true if the type object includes support for the cycle detector; this"
165180" tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`."
166- msgstr ""
181+ msgstr "如果类型对象包括了对循环检测器的支持则返回真值;这将测试类型旗标 :c:macro:`Py_TPFLAGS_HAVE_GC`。 "
167182
168183#: ../../c-api/type.rst:140
169184msgid "Return true if *a* is a subtype of *b*."
@@ -217,6 +232,9 @@ msgid ""
217232" protocol itself by at least implementing the "
218233":c:member:`~PyTypeObject.tp_traverse` handle."
219234msgstr ""
235+ "如果某些基类实现了 GC 协议并且所提供的类型的旗标中未包括 :c:macro:`Py_TPFLAGS_HAVE_GC`,则将自动从其父类实现 GC "
236+ "协议。 相反地,如果被创建的类型的旗标中确实包含 :c:macro:`Py_TPFLAGS_HAVE_GC` 则它 **必须** 自己实现 GC "
237+ "协议,至少要实现 :c:member:`~PyTypeObject.tp_traverse` 句柄。"
220238
221239#: ../../c-api/type.rst:177
222240msgid ""
0 commit comments