66# Translators:
77889- # Freesand Leo <[email protected] >, 2019109# ppcfish <[email protected] >, 201910+ 11+ # Freesand Leo <[email protected] >, 20201112#
1213#, fuzzy
1314msgid ""
@@ -16,7 +17,7 @@ msgstr ""
1617"Report-Msgid-Bugs-To : \n "
1718"POT-Creation-Date : 2020-08-20 03:54+0000\n "
1819"PO-Revision-Date : 2017-02-16 17:39+0000\n "
19- "Last-Translator : ppcfish <ppcfish@gmail .com>, 2019 \n "
20+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2020 \n "
2021"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2122"MIME-Version : 1.0\n "
2223"Content-Type : text/plain; charset=UTF-8\n "
@@ -50,11 +51,11 @@ msgstr "如果 *p* 是一个元组对象或者元组类型的子类型的实例
5051msgid ""
5152"Return true if *p* is a tuple object, but not an instance of a subtype of "
5253"the tuple type."
53- msgstr "如果 *p* 是一个元组对象,而不是一个元组子类型的实例 ,则返回真值。"
54+ msgstr "如果 *p* 是一个元组对象,而不是一个元组类型的子类型实例 ,则返回真值。"
5455
5556#: ../../c-api/tuple.rst:36
5657msgid "Return a new tuple object of size *len*, or ``NULL`` on failure."
57- msgstr ""
58+ msgstr "成功时返回一个新的元组对象,长度为 *len*,失败时返回``NULL``。 "
5859
5960#: ../../c-api/tuple.rst:41
6061msgid ""
@@ -63,53 +64,61 @@ msgid ""
6364"objects. ``PyTuple_Pack(2, a, b)`` is equivalent to "
6465"``Py_BuildValue(\" (OO)\" , a, b)``."
6566msgstr ""
67+ "成功时返回一个新的元组对象,大小为 *n* ,失败时返回 ``NULL``。 元组值初始化为指向 Python 对象的后续 *n* 个 C 参数。 "
68+ "``PyTuple_Pack(2, a, b)`` 和 ``Py_BuildValue(\" (OO)\" , a, b)`` 相等。"
6669
6770#: ../../c-api/tuple.rst:48
6871msgid "Take a pointer to a tuple object, and return the size of that tuple."
69- msgstr ""
72+ msgstr "获取指向元组对象的指针,并返回该元组的大小。 "
7073
7174#: ../../c-api/tuple.rst:53
7275msgid ""
7376"Return the size of the tuple *p*, which must be non-``NULL`` and point to a "
7477"tuple; no error checking is performed."
75- msgstr ""
78+ msgstr "返回元组 *p* 的大小,它必须为非 ``NULL`` 并且指向一个元组;不执行错误检查。 "
7679
7780#: ../../c-api/tuple.rst:59
7881msgid ""
7982"Return the object at position *pos* in the tuple pointed to by *p*. If "
8083"*pos* is out of bounds, return ``NULL`` and set an :exc:`IndexError` "
8184"exception."
8285msgstr ""
86+ "返回 *p* 所指向的元组中,位于 *pos* 处的对象。 如果 *pos* 超出界限,返回 ``NULL``,并抛出一个 "
87+ ":exc:`IndexError` 异常。"
8388
8489#: ../../c-api/tuple.rst:65
8590msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments."
86- msgstr ""
91+ msgstr "类似于 :c:func:`PyTuple_GetItem`,但不检查其参数。 "
8792
8893#: ../../c-api/tuple.rst:70
8994msgid ""
9095"Return the slice of the tuple pointed to by *p* between *low* and *high*, or"
9196" ``NULL`` on failure. This is the equivalent of the Python expression "
9297"``p[low:high]``. Indexing from the end of the list is not supported."
9398msgstr ""
99+ "返回 *p* 所指向的元组的切片,在 *low* 和 *high* 之间,或者在失败时返回 ``NULL``。 这等同于 Python 表达式 "
100+ "``p[low:high]``。 不支持从列表末尾索引。"
94101
95102#: ../../c-api/tuple.rst:77
96103msgid ""
97104"Insert a reference to object *o* at position *pos* of the tuple pointed to "
98105"by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` "
99106"and set an :exc:`IndexError` exception."
100107msgstr ""
108+ "在 *p* 指向的元组的 *pos* 位置插入对对象 *o* 的引用。 成功时返回 ``0``;如果 *pos* 越界,则返回 ``-1``,并抛出一个"
109+ " :exc:`IndexError` 异常。"
101110
102111#: ../../c-api/tuple.rst:83
103112msgid ""
104113"This function \" steals\" a reference to *o* and discards a reference to an "
105114"item already in the tuple at the affected position."
106- msgstr ""
115+ msgstr "此函数会“窃取”对 *o* 的引用,并丢弃对元组中已在受影响位置的条目的引用。 "
107116
108117#: ../../c-api/tuple.rst:89
109118msgid ""
110119"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should "
111120"*only* be used to fill in brand new tuples."
112- msgstr ""
121+ msgstr "类似于 :c:func:`PyTuple_SetItem`,但不进行错误检查,并且应该 *只是* 被用来填充全新的元组。 "
113122
114123#: ../../c-api/tuple.rst:94
115124msgid ""
@@ -118,6 +127,8 @@ msgid ""
118127"is being replaced; any reference in the tuple at position *pos* will be "
119128"leaked."
120129msgstr ""
130+ "这个宏会“偷走”一个对 *o* 的引用,但与 :c:func:`PyTuple_SetItem` 不同,它 *不会* "
131+ "丢弃对任何被替换项的引用;元组中位于 *pos* 位置的任何引用都将被泄漏。"
121132
122133#: ../../c-api/tuple.rst:102
123134msgid ""
@@ -133,10 +144,15 @@ msgid ""
133144"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or "
134145":exc:`SystemError`."
135146msgstr ""
147+ "可以用于调整元组的大小。 *newsize* 将是元组的新长度。 因为元组 *被认为* 是不可变的,所以只有在对象仅有一个引用时,才应该使用它。 "
148+ "如果元组已经被代码的其他部分所引用,请不要使用此项。 元组在最后总是会增长或缩小。 把它看作是销毁旧元组并创建一个新元组,只会更有效。 成功时返回 "
149+ "``0`` 。 客户端代码不应假定 ``*p`` 的结果值将与调用此函数之前的值相同。 如果替换了 ``*p`` 引用的对象,则原始的 ``*p`` "
150+ "将被销毁。 失败时,返回``-1``,将 ``*p`` 设置为 ``NULL``,并引发 :exc:`MemoryError` 或者 "
151+ ":exc:`SystemError`。"
136152
137153#: ../../c-api/tuple.rst:115
138154msgid "Struct Sequence Objects"
139- msgstr ""
155+ msgstr "结构序列对象 "
140156
141157#: ../../c-api/tuple.rst:117
142158msgid ""
@@ -145,23 +161,27 @@ msgid ""
145161"also be accessed through attributes. To create a struct sequence, you first "
146162"have to create a specific struct sequence type."
147163msgstr ""
164+ "结构序列对象是等价于 :func:`~collections.namedtuple` 的 C 对象,即一个序列,其中的条目也可以通过属性访问。 "
165+ "要创建结构序列,你首先必须创建特定的结构序列类型。"
148166
149167#: ../../c-api/tuple.rst:124
150168msgid ""
151169"Create a new struct sequence type from the data in *desc*, described below. "
152170"Instances of the resulting type can be created with "
153171":c:func:`PyStructSequence_New`."
154172msgstr ""
173+ "根据 *desc* 中的数据创建一个新的结构序列类型,如下所述。 可以使用 :c:func:`PyStructSequence_New` "
174+ "创建结果类型的实例。"
155175
156176#: ../../c-api/tuple.rst:130
157177msgid "Initializes a struct sequence type *type* from *desc* in place."
158- msgstr ""
178+ msgstr "从 *desc* 就地初始化结构序列类型 *type*。 "
159179
160180#: ../../c-api/tuple.rst:135
161181msgid ""
162182"The same as ``PyStructSequence_InitType``, but returns ``0`` on success and "
163183"``-1`` on failure."
164- msgstr ""
184+ msgstr "与 ``PyStructSequence_InitType`` 相同,但成功时返回 ``0`` ,失败时返回 ``-1`` 。 "
165185
166186#: ../../c-api/tuple.rst:143
167187msgid "Contains the meta information of a struct sequence type to create."
@@ -198,7 +218,7 @@ msgstr "``doc``"
198218
199219#: ../../c-api/tuple.rst:150
200220msgid "pointer to docstring for the type or ``NULL`` to omit"
201- msgstr ""
221+ msgstr "指向要忽略类型的文档字符串或 ``NULL`` 的指针 "
202222
203223#: ../../c-api/tuple.rst:153
204224msgid "``fields``"
@@ -210,7 +230,7 @@ msgstr "``PyStructSequence_Field *``"
210230
211231#: ../../c-api/tuple.rst:153
212232msgid "pointer to ``NULL``-terminated array with field names of the new type"
213- msgstr ""
233+ msgstr "指向以 ``NULL`` 结尾的数组的指针,其字段名称为新类型 "
214234
215235#: ../../c-api/tuple.rst:156
216236msgid "``n_in_sequence``"
@@ -222,7 +242,7 @@ msgstr "``int``"
222242
223243#: ../../c-api/tuple.rst:156
224244msgid "number of fields visible to the Python side (if used as tuple)"
225- msgstr ""
245+ msgstr "Python侧可见的字段数(如果用作元组) "
226246
227247#: ../../c-api/tuple.rst:163
228248msgid ""
@@ -231,52 +251,58 @@ msgid ""
231251":attr:`fields` array of the :c:type:`PyStructSequence_Desc` determines which"
232252" field of the struct sequence is described."
233253msgstr ""
254+ "描述结构序列的一个字段。 当结构序列被建模为元组时,所有字段的类型都是 :c:type:`PyObject*`。 在 "
255+ ":c:type:`PyStructSequence_Desc` 的 :attr:`fields` 数组中的索引确定了结构序列描述的是哪个字段。"
234256
235257#: ../../c-api/tuple.rst:171
236258msgid ""
237259"name for the field or ``NULL`` to end the list of named fields, set to "
238260":c:data:`PyStructSequence_UnnamedField` to leave unnamed"
239261msgstr ""
262+ "字段的名称或 ``NULL`` ,若要结束命名字段的列表,请设置为 :c:data:`PyStructSequence_UnnamedField` "
263+ "以保留未命名字段"
240264
241265#: ../../c-api/tuple.rst:176
242266msgid "field docstring or ``NULL`` to omit"
243- msgstr ""
267+ msgstr "要忽略的字段文档字符串或 ``NULL`` "
244268
245269#: ../../c-api/tuple.rst:182
246270msgid "Special value for a field name to leave it unnamed."
247- msgstr ""
271+ msgstr "字段名的特殊值将保持未命名状态。 "
248272
249273#: ../../c-api/tuple.rst:184
250274msgid "The type was changed from ``char *``."
251- msgstr ""
275+ msgstr "这个类型已从 ``char *`` 更改。 "
252276
253277#: ../../c-api/tuple.rst:190
254278msgid ""
255279"Creates an instance of *type*, which must have been created with "
256280":c:func:`PyStructSequence_NewType`."
257- msgstr ""
281+ msgstr "创建 *type* 的实例,该实例必须使用 :c:func:`PyStructSequence_NewType` 创建。 "
258282
259283#: ../../c-api/tuple.rst:196
260284msgid ""
261285"Return the object at position *pos* in the struct sequence pointed to by "
262286"*p*. No bounds checking is performed."
263- msgstr ""
287+ msgstr "返回 *p* 所指向的结构序列中,位于 *pos* 处的对象。不需要进行边界检查。 "
264288
265289#: ../../c-api/tuple.rst:202
266290msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`."
267- msgstr ""
291+ msgstr ":c:func:`PyStructSequence_GetItem` 的宏版本。 "
268292
269293#: ../../c-api/tuple.rst:207
270294msgid ""
271295"Sets the field at index *pos* of the struct sequence *p* to value *o*. Like"
272296" :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand new "
273297"instances."
274298msgstr ""
299+ "将结构序列 *p* 的索引 *pos* 处的字段设置为值 *o*。 与 :c:func:`PyTuple_SET_ITEM` "
300+ "一样,它应该只用于填充全新的实例。"
275301
276302#: ../../c-api/tuple.rst:213 ../../c-api/tuple.rst:222
277303msgid "This function \" steals\" a reference to *o*."
278- msgstr ""
304+ msgstr "这个函数“窃取”了指向 *o* 的一个引用。 "
279305
280306#: ../../c-api/tuple.rst:218
281307msgid "Macro equivalent of :c:func:`PyStructSequence_SetItem`."
282- msgstr ""
308+ msgstr ":c:func:`PyStructSequence_SetItem` 的宏版本。 "
0 commit comments