44# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
55#
66# Translators:
7- # Freesand Leo <[email protected] >, 20208798# ppcfish <[email protected] >, 20209+ 10+ # Freesand Leo <[email protected] >, 20201011#
1112#, fuzzy
1213msgid ""
@@ -15,7 +16,7 @@ msgstr ""
1516"Report-Msgid-Bugs-To : \n "
1617"POT-Creation-Date : 2020-08-20 14:53+0000\n "
1718"PO-Revision-Date : 2020-05-30 11:51+0000\n "
18- "Last-Translator : ppcfish <ppcfish@gmail .com>, 2020\n "
19+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2020\n "
1920"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2021"MIME-Version : 1.0\n "
2122"Content-Type : text/plain; charset=UTF-8\n "
@@ -53,7 +54,7 @@ msgstr "如果 *p* 是一个元组对象,而不是一个元组子类型的实
5354
5455#: ../../c-api/tuple.rst:36
5556msgid "Return a new tuple object of size *len*, or ``NULL`` on failure."
56- msgstr ""
57+ msgstr "成功时返回一个新的元组对象,长度为 *len*,失败时返回“NULL”。 "
5758
5859#: ../../c-api/tuple.rst:41
5960msgid ""
@@ -62,53 +63,61 @@ msgid ""
6263"objects. ``PyTuple_Pack(2, a, b)`` is equivalent to "
6364"``Py_BuildValue(\" (OO)\" , a, b)``."
6465msgstr ""
66+ "成功时返回一个新的元组对象,大小为 *n* ,失败时返回 ``NULL``。 元组值初始化为指向 Python 对象的后续 *n* C 参数。 "
67+ "``PyTuple_Pack(2, a, b)`` 和 ``Py_BuildValue(\" (OO)\" , a, b)`` 相等。"
6568
6669#: ../../c-api/tuple.rst:48
6770msgid "Take a pointer to a tuple object, and return the size of that tuple."
68- msgstr ""
71+ msgstr "获取指向元组对象的指针,并返回该元组的大小。 "
6972
7073#: ../../c-api/tuple.rst:53
7174msgid ""
7275"Return the size of the tuple *p*, which must be non-``NULL`` and point to a "
7376"tuple; no error checking is performed."
74- msgstr ""
77+ msgstr "返回元组*p*的大小,它必须是非``NULL``并且指向一个元组;不执行错误检查 "
7578
7679#: ../../c-api/tuple.rst:59
7780msgid ""
7881"Return the object at position *pos* in the tuple pointed to by *p*. If "
7982"*pos* is out of bounds, return ``NULL`` and set an :exc:`IndexError` "
8083"exception."
8184msgstr ""
85+ "返回 *p* 所指向的元组中,位于 *pos* 处的对象。 如果 *pos* 超出界限,返回 ``NULL`` ,并抛出一个 "
86+ ":exc:`IndexError` 异常。"
8287
8388#: ../../c-api/tuple.rst:65
8489msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments."
85- msgstr ""
90+ msgstr "类似于 :c:func:`PyTuple_GetItem`,但不检查其参数。 "
8691
8792#: ../../c-api/tuple.rst:70
8893msgid ""
8994"Return the slice of the tuple pointed to by *p* between *low* and *high*, or"
9095" ``NULL`` on failure. This is the equivalent of the Python expression "
9196"``p[low:high]``. Indexing from the end of the list is not supported."
9297msgstr ""
98+ "返回*p*所指向的元组的切片,在*low*和*high*之间,或者在失败时返回``NULL``。这等同于Python表达式:``p[low:high]``"
99+ " 。不支持从列表末尾索引。"
93100
94101#: ../../c-api/tuple.rst:77
95102msgid ""
96103"Insert a reference to object *o* at position *pos* of the tuple pointed to "
97104"by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` "
98105"and set an :exc:`IndexError` exception."
99106msgstr ""
107+ "在 *p* 指向的元组的 *pos* 位置插入对对象 *o* 的引用。 成功时返回 ``0``;如果 *pos* 越界,则返回 ``-1``,并抛出一个"
108+ " :exc:`IndexError` 异常。"
100109
101110#: ../../c-api/tuple.rst:83
102111msgid ""
103112"This function \" steals\" a reference to *o* and discards a reference to an "
104113"item already in the tuple at the affected position."
105- msgstr ""
114+ msgstr "此函数会“窃取”对*o*的引用,并丢弃对元组中已在受影响位置的条目的引用。 "
106115
107116#: ../../c-api/tuple.rst:89
108117msgid ""
109118"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should "
110119"*only* be used to fill in brand new tuples."
111- msgstr ""
120+ msgstr "类似于 :c:func:`PyTuple_SetItem`,但不进行错误检查,并且应该 *只是* 被用来填充全新的元组。 "
112121
113122#: ../../c-api/tuple.rst:94
114123msgid ""
@@ -117,6 +126,8 @@ msgid ""
117126"is being replaced; any reference in the tuple at position *pos* will be "
118127"leaked."
119128msgstr ""
129+ "这个宏会“偷走”一个对 *o* 的引用,但与 :c:func:`PyTuple_SetItem` 不同,它 *不会* "
130+ "丢弃对任何被替换项的引用;元组中位于 *pos* 位置的任何引用都将被泄漏。"
120131
121132#: ../../c-api/tuple.rst:102
122133msgid ""
@@ -132,14 +143,19 @@ msgid ""
132143"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or "
133144":exc:`SystemError`."
134145msgstr ""
146+ "可以用于调整元组的大小。 *newsize* 将是元组的新长度。 因为元组 *被认为* 是不可变的,所以只有在对象仅有一个引用时,才应该使用它。 "
147+ "如果元组已经被代码的其他部分所引用,请不要使用此项。 元组在最后总是会增长或缩小。 把它看作是销毁旧元组并创建一个新元组,只会更有效。 成功时返回 "
148+ "``0`` 。 客户端代码不应假定 ``*p`` 的结果值将与调用此函数之前的值相同。 如果替换了 ``*p`` 引用的对象,则原始的 ``*p`` "
149+ "将被销毁。 失败时,返回``-1``,将 ``*p`` 设置为 ``NULL``,并引发 :exc:`MemoryError` 或者 "
150+ ":exc:`SystemError`。"
135151
136152#: ../../c-api/tuple.rst:116
137153msgid "Clear the free list. Return the total number of freed items."
138154msgstr "清空释放列表。 返回所释放的条目数。"
139155
140156#: ../../c-api/tuple.rst:120
141157msgid "Struct Sequence Objects"
142- msgstr ""
158+ msgstr "结构序列对象 "
143159
144160#: ../../c-api/tuple.rst:122
145161msgid ""
@@ -148,23 +164,27 @@ msgid ""
148164"also be accessed through attributes. To create a struct sequence, you first "
149165"have to create a specific struct sequence type."
150166msgstr ""
167+ "结构序列对象是等价于 :func:`~collections.namedtuple` 的 C 对象,即一个序列,其中的条目也可以通过属性访问。 "
168+ "要创建结构序列,你首先必须创建特定的结构序列类型。"
151169
152170#: ../../c-api/tuple.rst:129
153171msgid ""
154172"Create a new struct sequence type from the data in *desc*, described below. "
155173"Instances of the resulting type can be created with "
156174":c:func:`PyStructSequence_New`."
157175msgstr ""
176+ "根据 *desc* 中的数据创建一个新的结构序列类型,如下所述。 可以使用 :c:func:`PyStructSequence_New` "
177+ "创建结果类型的实例。"
158178
159179#: ../../c-api/tuple.rst:135
160180msgid "Initializes a struct sequence type *type* from *desc* in place."
161- msgstr ""
181+ msgstr "从*desc*就地初始化结构序列类型*type*。 "
162182
163183#: ../../c-api/tuple.rst:140
164184msgid ""
165185"The same as ``PyStructSequence_InitType``, but returns ``0`` on success and "
166186"``-1`` on failure."
167- msgstr ""
187+ msgstr "与 ``PyStructSequence_InitType`` 相同,但成功时返回 ``0`` ,失败时返回 ``-1`` 。 "
168188
169189#: ../../c-api/tuple.rst:148
170190msgid "Contains the meta information of a struct sequence type to create."
@@ -201,7 +221,7 @@ msgstr "``doc``"
201221
202222#: ../../c-api/tuple.rst:155
203223msgid "pointer to docstring for the type or ``NULL`` to omit"
204- msgstr ""
224+ msgstr "指向要忽略类型的文档字符串或 ``NULL`` 的指针 "
205225
206226#: ../../c-api/tuple.rst:158
207227msgid "``fields``"
@@ -213,7 +233,7 @@ msgstr "``PyStructSequence_Field *``"
213233
214234#: ../../c-api/tuple.rst:158
215235msgid "pointer to ``NULL``-terminated array with field names of the new type"
216- msgstr ""
236+ msgstr "指向以 ``NULL`` 结尾的数组的指针,其字段名称为新类型 "
217237
218238#: ../../c-api/tuple.rst:161
219239msgid "``n_in_sequence``"
@@ -225,7 +245,7 @@ msgstr "``int``"
225245
226246#: ../../c-api/tuple.rst:161
227247msgid "number of fields visible to the Python side (if used as tuple)"
228- msgstr ""
248+ msgstr "Python侧可见的字段数(如果用作元组) "
229249
230250#: ../../c-api/tuple.rst:168
231251msgid ""
@@ -234,48 +254,54 @@ msgid ""
234254":attr:`fields` array of the :c:type:`PyStructSequence_Desc` determines which"
235255" field of the struct sequence is described."
236256msgstr ""
257+ "描述结构序列的一个字段。 当结构序列被建模为元组时,所有字段的类型都是 :c:type:`PyObject*`。 在 "
258+ ":c:type:`PyStructSequence_Desc` 的 :attr:`fields` 数组中的索引确定了结构序列描述的是哪个字段。"
237259
238260#: ../../c-api/tuple.rst:176
239261msgid ""
240262"name for the field or ``NULL`` to end the list of named fields, set to "
241263":c:data:`PyStructSequence_UnnamedField` to leave unnamed"
242264msgstr ""
265+ "字段的名称或``NULL`` ,若要结束命名字段的列表,请设置为::c:data:`PyStructSequence_UnnamedField` "
266+ "以保留未命名字段"
243267
244268#: ../../c-api/tuple.rst:181
245269msgid "field docstring or ``NULL`` to omit"
246- msgstr ""
270+ msgstr "要忽略的字段docstring或``NULL`` "
247271
248272#: ../../c-api/tuple.rst:187
249273msgid "Special value for a field name to leave it unnamed."
250- msgstr ""
274+ msgstr "字段名的特殊值将保持未命名状态。 "
251275
252276#: ../../c-api/tuple.rst:192
253277msgid ""
254278"Creates an instance of *type*, which must have been created with "
255279":c:func:`PyStructSequence_NewType`."
256- msgstr ""
280+ msgstr "创建 *type* 的实例,该实例必须使用 :c:func:`PyStructSequence_NewType` 创建。 "
257281
258282#: ../../c-api/tuple.rst:198
259283msgid ""
260284"Return the object at position *pos* in the struct sequence pointed to by "
261285"*p*. No bounds checking is performed."
262- msgstr ""
286+ msgstr "返回*p*所指向的结构序列中,位于*pos*处的对象。不需要进行边界检查。 "
263287
264288#: ../../c-api/tuple.rst:204
265289msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`."
266- msgstr ""
290+ msgstr ":c:func:`PyStructSequence_GetItem` 的宏版本。 "
267291
268292#: ../../c-api/tuple.rst:209
269293msgid ""
270294"Sets the field at index *pos* of the struct sequence *p* to value *o*. Like"
271295" :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand new "
272296"instances."
273297msgstr ""
298+ "将结构序列 *p* 的索引 *pos* 处的字段设置为值 *o*。 与 :c:func:`PyTuple_SET_ITEM` "
299+ "一样,它应该只用于填充全新的实例。"
274300
275301#: ../../c-api/tuple.rst:215 ../../c-api/tuple.rst:224
276302msgid "This function \" steals\" a reference to *o*."
277- msgstr ""
303+ msgstr "这个函数“窃取”了指向*o*的一个引用。 "
278304
279305#: ../../c-api/tuple.rst:220
280306msgid "Macro equivalent of :c:func:`PyStructSequence_SetItem`."
281- msgstr ""
307+ msgstr ":c:func:`PyStructSequence_SetItem` 的宏版本。 "
0 commit comments