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

Skip to content

Commit 85af4e2

Browse files
[po] auto sync
1 parent bcb7dc9 commit 85af4e2

7 files changed

Lines changed: 6874 additions & 6830 deletions

File tree

c-api/gcsupport.po

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ msgid ""
1212
msgstr ""
1313
"Project-Id-Version: Python 3.9\n"
1414
"Report-Msgid-Bugs-To: \n"
15-
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
15+
"POT-Creation-Date: 2021-05-29 06:28+0000\n"
1616
"PO-Revision-Date: 2017-02-16 17:35+0000\n"
1717
"Last-Translator: Freesand Leo <[email protected]>, 2020\n"
1818
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -74,21 +74,39 @@ msgid ""
7474
"initialized, it must call :c:func:`PyObject_GC_Track`."
7575
msgstr "初始化了所有可能包含其他容器的引用的字段后,它必须调用 :c:func:`PyObject_GC_Track` 。"
7676

77-
#: ../../c-api/gcsupport.rst:39
77+
#: ../../c-api/gcsupport.rst:37
78+
msgid ""
79+
"If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a "
80+
":c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its"
81+
" subclass or subclasses."
82+
msgstr ""
83+
84+
#: ../../c-api/gcsupport.rst:41
85+
msgid ""
86+
"When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call"
87+
" it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the"
88+
" interpreter will automatically populate the "
89+
":c:member:`~PyTypeObject.tp_flags`, :c:member:`~PyTypeObject.tp_traverse` "
90+
"and :c:member:`~PyTypeObject.tp_clear` fields if the type inherits from a "
91+
"class that implements the garbage collector protocol and the child class "
92+
"does *not* include the :const:`Py_TPFLAGS_HAVE_GC` flag."
93+
msgstr ""
94+
95+
#: ../../c-api/gcsupport.rst:51
7896
msgid ""
7997
"Analogous to :c:func:`PyObject_New` but for container objects with the "
8098
":const:`Py_TPFLAGS_HAVE_GC` flag set."
8199
msgstr ""
82100
"类似于 :c:func:`PyObject_New` ,适用于设置了 :const:`Py_TPFLAGS_HAVE_GC` 标签的容器对象。"
83101

84-
#: ../../c-api/gcsupport.rst:45
102+
#: ../../c-api/gcsupport.rst:57
85103
msgid ""
86104
"Analogous to :c:func:`PyObject_NewVar` but for container objects with the "
87105
":const:`Py_TPFLAGS_HAVE_GC` flag set."
88106
msgstr ""
89107
"类似于 :c:func:`PyObject_NewVar` ,适用于设置了 :const:`Py_TPFLAGS_HAVE_GC` 标签的容器对象。"
90108

91-
#: ../../c-api/gcsupport.rst:51
109+
#: ../../c-api/gcsupport.rst:63
92110
msgid ""
93111
"Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the "
94112
"resized object or ``NULL`` on failure. *op* must not be tracked by the "
@@ -97,7 +115,7 @@ msgstr ""
97115
"为 :c:func:`PyObject_NewVar` 所分配对象重新调整大小。 返回调整大小后的对象或在失败时返回 ``NULL``。 *op* "
98116
"必须尚未被垃圾回收器追踪。"
99117

100-
#: ../../c-api/gcsupport.rst:57
118+
#: ../../c-api/gcsupport.rst:69
101119
msgid ""
102120
"Adds the object *op* to the set of container objects tracked by the "
103121
"collector. The collector can run at unexpected times so objects must be "
@@ -108,64 +126,64 @@ msgstr ""
108126
"把对象 *op* 加入到垃圾回收器跟踪的容器对象中。对象在被回收器跟踪时必须保持有效的,因为回收器可能在任何时候开始运行。在 "
109127
":c:member:`~PyTypeObject.tp_traverse` 处理前的所有字段变为有效后,必须调用此函数,通常在靠近构造函数末尾的位置。"
110128

111-
#: ../../c-api/gcsupport.rst:66
129+
#: ../../c-api/gcsupport.rst:78
112130
msgid ""
113131
"Returns non-zero if the object implements the garbage collector protocol, "
114132
"otherwise returns 0."
115133
msgstr "如果对象实现了垃圾回收器协议则返回非零值,否则返回 0。"
116134

117-
#: ../../c-api/gcsupport.rst:69
135+
#: ../../c-api/gcsupport.rst:81
118136
msgid ""
119137
"The object cannot be tracked by the garbage collector if this function "
120138
"returns 0."
121139
msgstr "如果此函数返回 0 则对象无法被垃圾回收器追踪。"
122140

123-
#: ../../c-api/gcsupport.rst:74
141+
#: ../../c-api/gcsupport.rst:86
124142
msgid ""
125143
"Returns 1 if the object type of *op* implements the GC protocol and *op* is "
126144
"being currently tracked by the garbage collector and 0 otherwise."
127145
msgstr "如果 *op* 对象的类型实现了 GC 协议且 *op* 目前正被垃圾回收器追踪则返回 1, 否则返回 0。"
128146

129-
#: ../../c-api/gcsupport.rst:77
147+
#: ../../c-api/gcsupport.rst:89
130148
msgid "This is analogous to the Python function :func:`gc.is_tracked`."
131149
msgstr "这类似于 Python 函数 :func:`gc.is_tracked`。"
132150

133-
#: ../../c-api/gcsupport.rst:84
151+
#: ../../c-api/gcsupport.rst:96
134152
msgid ""
135153
"Returns 1 if the object type of *op* implements the GC protocol and *op* has"
136154
" been already finalized by the garbage collector and 0 otherwise."
137155
msgstr "如果 *op* 对象的类型实现了 GC 协议且 *op* 已经被垃圾回收器终结则返回 1, 否则返回 0。"
138156

139-
#: ../../c-api/gcsupport.rst:87
157+
#: ../../c-api/gcsupport.rst:99
140158
msgid "This is analogous to the Python function :func:`gc.is_finalized`."
141159
msgstr "这类似于 Python 函数 :func:`gc.is_finalized`。"
142160

143-
#: ../../c-api/gcsupport.rst:91
161+
#: ../../c-api/gcsupport.rst:103
144162
msgid ""
145163
"Similarly, the deallocator for the object must conform to a similar pair of "
146164
"rules:"
147165
msgstr "同样的,对象的释放器必须符合两个类似的规则:"
148166

149-
#: ../../c-api/gcsupport.rst:94
167+
#: ../../c-api/gcsupport.rst:106
150168
msgid ""
151169
"Before fields which refer to other containers are invalidated, "
152170
":c:func:`PyObject_GC_UnTrack` must be called."
153171
msgstr "在引用其它容器的字段失效前,必须调用 :c:func:`PyObject_GC_UnTrack` 。"
154172

155-
#: ../../c-api/gcsupport.rst:97
173+
#: ../../c-api/gcsupport.rst:109
156174
msgid ""
157175
"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`."
158176
msgstr "必须使用 :c:func:`PyObject_GC_Del` 释放对象的内存。"
159177

160-
#: ../../c-api/gcsupport.rst:102
178+
#: ../../c-api/gcsupport.rst:114
161179
msgid ""
162180
"Releases memory allocated to an object using :c:func:`PyObject_GC_New` or "
163181
":c:func:`PyObject_GC_NewVar`."
164182
msgstr ""
165183
"释放对象的内存,该对象初始化时由 :c:func:`PyObject_GC_New` 或 :c:func:`PyObject_GC_NewVar` "
166184
"分配内存。"
167185

168-
#: ../../c-api/gcsupport.rst:108
186+
#: ../../c-api/gcsupport.rst:120
169187
msgid ""
170188
"Remove the object *op* from the set of container objects tracked by the "
171189
"collector. Note that :c:func:`PyObject_GC_Track` can be called again on "
@@ -178,21 +196,21 @@ msgstr ""
178196
"以将其加回到被跟踪对象集合。 释放器 (:c:member:`~PyTypeObject.tp_dealloc` 句柄) 应当在 "
179197
":c:member:`~PyTypeObject.tp_traverse` 句柄所使用的任何字段失效之前为对象调用此函数。"
180198

181-
#: ../../c-api/gcsupport.rst:117
199+
#: ../../c-api/gcsupport.rst:129
182200
msgid ""
183201
"The :c:func:`_PyObject_GC_TRACK` and :c:func:`_PyObject_GC_UNTRACK` macros "
184202
"have been removed from the public C API."
185203
msgstr ""
186204
":c:func:`_PyObject_GC_TRACK` 和 :c:func:`_PyObject_GC_UNTRACK` 宏已从公有 C API "
187205
"中移除。"
188206

189-
#: ../../c-api/gcsupport.rst:120
207+
#: ../../c-api/gcsupport.rst:132
190208
msgid ""
191209
"The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function "
192210
"parameter of this type:"
193211
msgstr ":c:member:`~PyTypeObject.tp_traverse` 处理接收以下类型的函数形参。"
194212

195-
#: ../../c-api/gcsupport.rst:125
213+
#: ../../c-api/gcsupport.rst:137
196214
msgid ""
197215
"Type of the visitor function passed to the "
198216
":c:member:`~PyTypeObject.tp_traverse` handler. The function should be called"
@@ -205,13 +223,13 @@ msgstr ""
205223
"是容器中需要被遍历的一个对象,第三个形参对应于 :c:member:`~PyTypeObject.tp_traverse` 处理的 *arg* "
206224
"。Python核心使用多个访问者函数实现循环引用的垃圾检测,不需要用户自行实现访问者函数。"
207225

208-
#: ../../c-api/gcsupport.rst:132
226+
#: ../../c-api/gcsupport.rst:144
209227
msgid ""
210228
"The :c:member:`~PyTypeObject.tp_traverse` handler must have the following "
211229
"type:"
212230
msgstr ":c:member:`~PyTypeObject.tp_traverse` 处理必须是以下类型:"
213231

214-
#: ../../c-api/gcsupport.rst:137
232+
#: ../../c-api/gcsupport.rst:149
215233
msgid ""
216234
"Traversal function for a container object. Implementations must call the "
217235
"*visit* function for each object directly contained by *self*, with the "
@@ -224,7 +242,7 @@ msgstr ""
224242
"的形参为所包含对象和传给处理程序的 *arg* 值。 *visit* 函数调用不可附带 ``NULL`` 对象作为参数。 如果 *visit* "
225243
"返回非零值,则该值应当被立即返回。"
226244

227-
#: ../../c-api/gcsupport.rst:144
245+
#: ../../c-api/gcsupport.rst:156
228246
msgid ""
229247
"To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a "
230248
":c:func:`Py_VISIT` macro is provided. In order to use this macro, the "
@@ -235,7 +253,7 @@ msgstr ""
235253
":c:func:`Py_VISIT` 宏。若要使用这个宏,必须把 :c:member:`~PyTypeObject.tp_traverse` "
236254
"的参数命名为 *visit* 和 *arg* 。"
237255

238-
#: ../../c-api/gcsupport.rst:151
256+
#: ../../c-api/gcsupport.rst:163
239257
msgid ""
240258
"If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and "
241259
"*arg*. If *visit* returns a non-zero value, then return it. Using this "
@@ -244,15 +262,15 @@ msgstr ""
244262
"如果 *o* 不为 ``NULL``,则调用 *visit* 回调函数,附带参数 *o* 和 *arg*。 如果 *visit* "
245263
"返回一个非零值,则返回该值。 使用此宏之后,:c:member:`~PyTypeObject.tp_traverse` 处理程序的形式如下::"
246264

247-
#: ../../c-api/gcsupport.rst:164
265+
#: ../../c-api/gcsupport.rst:176
248266
msgid ""
249267
"The :c:member:`~PyTypeObject.tp_clear` handler must be of the "
250268
":c:type:`inquiry` type, or ``NULL`` if the object is immutable."
251269
msgstr ""
252270
":c:member:`~PyTypeObject.tp_clear` 处理程序必须为 :c:type:`inquiry` 类型,如果对象不可变则为 "
253271
"``NULL``。"
254272

255-
#: ../../c-api/gcsupport.rst:170
273+
#: ../../c-api/gcsupport.rst:182
256274
msgid ""
257275
"Drop references that may have created reference cycles. Immutable objects "
258276
"do not have to define this method since they can never directly create "

c-api/intro.po

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ msgid ""
213213
"avoids a warning about unreachable code. For example, the macro is "
214214
"implemented with ``__builtin_unreachable()`` on GCC in release mode."
215215
msgstr ""
216+
"在 release 模式下,该宏帮助编译器优化代码,并避免发出不可到达代码的警告。例如,在 GCC 的 release 模式下,该宏使用 "
217+
"``__builtin_unreachable()`` 实现。"
216218

217219
#: ../../c-api/intro.rst:119
218220
msgid ""

0 commit comments

Comments
 (0)