-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathtuple.po
308 lines (260 loc) · 12.8 KB
/
tuple.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# 操旭 <caoxu3000@126.com>, 2017
# dykai <yingkaidang@gmail.com>, 2019
# ppcfish <ppcfish@gmail.com>, 2019
# 伟 裴 <sky_wander@outlook.com>, 2020
# Freesand Leo <yuqinju@163.com>, 2021
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.9\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-04 14:34+0000\n"
"PO-Revision-Date: 2017-02-16 17:39+0000\n"
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2021\n"
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../c-api/tuple.rst:6
msgid "Tuple Objects"
msgstr "元组对象"
#: ../../c-api/tuple.rst:13
msgid "This subtype of :c:type:`PyObject` represents a Python tuple object."
msgstr "这个 :c:type:`PyObject` 的子类型代表一个 Python 的元组对象。"
#: ../../c-api/tuple.rst:18
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python tuple type; it"
" is the same object as :class:`tuple` in the Python layer."
msgstr ""
":c:type:`PyTypeObject` 的实例代表一个 Python 元组类型,这与 Python 层面的 :class:`tuple` "
"是相同的对象。"
#: ../../c-api/tuple.rst:24
msgid ""
"Return true if *p* is a tuple object or an instance of a subtype of the "
"tuple type. This function always succeeds."
msgstr "如果 *p* 是一个 tuple 对象或者 tuple 类型的子类型的实例则返回真值。 此函数总是会成功执行。"
#: ../../c-api/tuple.rst:30
msgid ""
"Return true if *p* is a tuple object, but not an instance of a subtype of "
"the tuple type. This function always succeeds."
msgstr "如果 *p* 是一个 tuple 对象但不是 tuple 类型的子类型的实例则返回真值。 此函数总是会成功执行。"
#: ../../c-api/tuple.rst:36
msgid "Return a new tuple object of size *len*, or ``NULL`` on failure."
msgstr "成功时返回一个新的元组对象,长度为 *len*,失败时返回``NULL``。"
#: ../../c-api/tuple.rst:41
msgid ""
"Return a new tuple object of size *n*, or ``NULL`` on failure. The tuple "
"values are initialized to the subsequent *n* C arguments pointing to Python "
"objects. ``PyTuple_Pack(2, a, b)`` is equivalent to "
"``Py_BuildValue(\"(OO)\", a, b)``."
msgstr ""
"成功时返回一个新的元组对象,大小为 *n* ,失败时返回 ``NULL``。 元组值初始化为指向 Python 对象的后续 *n* 个 C 参数。 "
"``PyTuple_Pack(2, a, b)`` 和 ``Py_BuildValue(\"(OO)\", a, b)`` 相等。"
#: ../../c-api/tuple.rst:48
msgid "Take a pointer to a tuple object, and return the size of that tuple."
msgstr "获取指向元组对象的指针,并返回该元组的大小。"
#: ../../c-api/tuple.rst:53
msgid ""
"Return the size of the tuple *p*, which must be non-``NULL`` and point to a "
"tuple; no error checking is performed."
msgstr "返回元组 *p* 的大小,它必须为非 ``NULL`` 并且指向一个元组;不执行错误检查。"
#: ../../c-api/tuple.rst:59
msgid ""
"Return the object at position *pos* in the tuple pointed to by *p*. If "
"*pos* is out of bounds, return ``NULL`` and set an :exc:`IndexError` "
"exception."
msgstr ""
"返回 *p* 所指向的元组中,位于 *pos* 处的对象。 如果 *pos* 超出界限,返回 ``NULL``,并抛出一个 "
":exc:`IndexError` 异常。"
#: ../../c-api/tuple.rst:65
msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments."
msgstr "类似于 :c:func:`PyTuple_GetItem`,但不检查其参数。"
#: ../../c-api/tuple.rst:70
msgid ""
"Return the slice of the tuple pointed to by *p* between *low* and *high*, or"
" ``NULL`` on failure. This is the equivalent of the Python expression "
"``p[low:high]``. Indexing from the end of the list is not supported."
msgstr ""
"返回 *p* 所指向的元组的切片,在 *low* 和 *high* 之间,或者在失败时返回 ``NULL``。 这等同于 Python 表达式 "
"``p[low:high]``。 不支持从列表末尾索引。"
#: ../../c-api/tuple.rst:77
msgid ""
"Insert a reference to object *o* at position *pos* of the tuple pointed to "
"by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` "
"and set an :exc:`IndexError` exception."
msgstr ""
"在 *p* 指向的元组的 *pos* 位置插入对对象 *o* 的引用。 成功时返回 ``0``;如果 *pos* 越界,则返回 ``-1``,并抛出一个"
" :exc:`IndexError` 异常。"
#: ../../c-api/tuple.rst:83
msgid ""
"This function \"steals\" a reference to *o* and discards a reference to an "
"item already in the tuple at the affected position."
msgstr "此函数会“窃取”对 *o* 的引用,并丢弃对元组中已在受影响位置的条目的引用。"
#: ../../c-api/tuple.rst:89
msgid ""
"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should "
"*only* be used to fill in brand new tuples."
msgstr "类似于 :c:func:`PyTuple_SetItem`,但不进行错误检查,并且应该 *只是* 被用来填充全新的元组。"
#: ../../c-api/tuple.rst:94
msgid ""
"This macro \"steals\" a reference to *o*, and, unlike "
":c:func:`PyTuple_SetItem`, does *not* discard a reference to any item that "
"is being replaced; any reference in the tuple at position *pos* will be "
"leaked."
msgstr ""
"这个宏会“偷走”一个对 *o* 的引用,但与 :c:func:`PyTuple_SetItem` 不同,它 *不会* "
"丢弃对任何被替换项的引用;元组中位于 *pos* 位置的任何引用都将被泄漏。"
#: ../../c-api/tuple.rst:102
msgid ""
"Can be used to resize a tuple. *newsize* will be the new length of the "
"tuple. Because tuples are *supposed* to be immutable, this should only be "
"used if there is only one reference to the object. Do *not* use this if the"
" tuple may already be known to some other part of the code. The tuple will "
"always grow or shrink at the end. Think of this as destroying the old tuple"
" and creating a new one, only more efficiently. Returns ``0`` on success. "
"Client code should never assume that the resulting value of ``*p`` will be "
"the same as before calling this function. If the object referenced by ``*p``"
" is replaced, the original ``*p`` is destroyed. On failure, returns ``-1`` "
"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or "
":exc:`SystemError`."
msgstr ""
"可以用于调整元组的大小。 *newsize* 将是元组的新长度。 因为元组 *被认为* 是不可变的,所以只有在对象仅有一个引用时,才应该使用它。 "
"如果元组已经被代码的其他部分所引用,请不要使用此项。 元组在最后总是会增长或缩小。 把它看作是销毁旧元组并创建一个新元组,只会更有效。 成功时返回 "
"``0`` 。 客户端代码不应假定 ``*p`` 的结果值将与调用此函数之前的值相同。 如果替换了 ``*p`` 引用的对象,则原始的 ``*p`` "
"将被销毁。 失败时,返回``-1``,将 ``*p`` 设置为 ``NULL``,并引发 :exc:`MemoryError` 或者 "
":exc:`SystemError`。"
#: ../../c-api/tuple.rst:115
msgid "Struct Sequence Objects"
msgstr "结构序列对象"
#: ../../c-api/tuple.rst:117
msgid ""
"Struct sequence objects are the C equivalent of "
":func:`~collections.namedtuple` objects, i.e. a sequence whose items can "
"also be accessed through attributes. To create a struct sequence, you first "
"have to create a specific struct sequence type."
msgstr ""
"结构序列对象是等价于 :func:`~collections.namedtuple` 的 C 对象,即一个序列,其中的条目也可以通过属性访问。 "
"要创建结构序列,你首先必须创建特定的结构序列类型。"
#: ../../c-api/tuple.rst:124
msgid ""
"Create a new struct sequence type from the data in *desc*, described below. "
"Instances of the resulting type can be created with "
":c:func:`PyStructSequence_New`."
msgstr ""
"根据 *desc* 中的数据创建一个新的结构序列类型,如下所述。 可以使用 :c:func:`PyStructSequence_New` "
"创建结果类型的实例。"
#: ../../c-api/tuple.rst:130
msgid "Initializes a struct sequence type *type* from *desc* in place."
msgstr "从 *desc* 就地初始化结构序列类型 *type*。"
#: ../../c-api/tuple.rst:135
msgid ""
"The same as ``PyStructSequence_InitType``, but returns ``0`` on success and "
"``-1`` on failure."
msgstr "与 ``PyStructSequence_InitType`` 相同,但成功时返回 ``0`` ,失败时返回 ``-1`` 。"
#: ../../c-api/tuple.rst:143
msgid "Contains the meta information of a struct sequence type to create."
msgstr "包含要创建的结构序列类型的元信息。"
#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169
msgid "Field"
msgstr "域"
#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169
msgid "C Type"
msgstr "C 类型"
#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169
msgid "Meaning"
msgstr "意义"
#: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:171
msgid "``name``"
msgstr "``name``"
#: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:150
#: ../../c-api/tuple.rst:171 ../../c-api/tuple.rst:176
msgid "``const char *``"
msgstr "``const char *``"
#: ../../c-api/tuple.rst:148
msgid "name of the struct sequence type"
msgstr "结构序列类型的名称"
#: ../../c-api/tuple.rst:150 ../../c-api/tuple.rst:176
msgid "``doc``"
msgstr "``doc``"
#: ../../c-api/tuple.rst:150
msgid "pointer to docstring for the type or ``NULL`` to omit"
msgstr "指向要忽略类型的文档字符串或 ``NULL`` 的指针"
#: ../../c-api/tuple.rst:153
msgid "``fields``"
msgstr "``fields``"
#: ../../c-api/tuple.rst:153
msgid "``PyStructSequence_Field *``"
msgstr "``PyStructSequence_Field *``"
#: ../../c-api/tuple.rst:153
msgid "pointer to ``NULL``-terminated array with field names of the new type"
msgstr "指向以 ``NULL`` 结尾的数组的指针,其字段名称为新类型"
#: ../../c-api/tuple.rst:156
msgid "``n_in_sequence``"
msgstr "``n_in_sequence``"
#: ../../c-api/tuple.rst:156
msgid "``int``"
msgstr "``int``"
#: ../../c-api/tuple.rst:156
msgid "number of fields visible to the Python side (if used as tuple)"
msgstr "Python侧可见的字段数(如果用作元组)"
#: ../../c-api/tuple.rst:163
msgid ""
"Describes a field of a struct sequence. As a struct sequence is modeled as a"
" tuple, all fields are typed as :c:type:`PyObject*`. The index in the "
":attr:`fields` array of the :c:type:`PyStructSequence_Desc` determines which"
" field of the struct sequence is described."
msgstr ""
"描述结构序列的一个字段。 当结构序列被建模为元组时,所有字段的类型都是 :c:type:`PyObject*`。 在 "
":c:type:`PyStructSequence_Desc` 的 :attr:`fields` 数组中的索引确定了结构序列描述的是哪个字段。"
#: ../../c-api/tuple.rst:171
msgid ""
"name for the field or ``NULL`` to end the list of named fields, set to "
":c:data:`PyStructSequence_UnnamedField` to leave unnamed"
msgstr ""
"字段的名称或 ``NULL`` ,若要结束命名字段的列表,请设置为 :c:data:`PyStructSequence_UnnamedField` "
"以保留未命名字段"
#: ../../c-api/tuple.rst:176
msgid "field docstring or ``NULL`` to omit"
msgstr "要忽略的字段文档字符串或 ``NULL``"
#: ../../c-api/tuple.rst:182
msgid "Special value for a field name to leave it unnamed."
msgstr "字段名的特殊值将保持未命名状态。"
#: ../../c-api/tuple.rst:184
msgid "The type was changed from ``char *``."
msgstr "这个类型已从 ``char *`` 更改。"
#: ../../c-api/tuple.rst:190
msgid ""
"Creates an instance of *type*, which must have been created with "
":c:func:`PyStructSequence_NewType`."
msgstr "创建 *type* 的实例,该实例必须使用 :c:func:`PyStructSequence_NewType` 创建。"
#: ../../c-api/tuple.rst:196
msgid ""
"Return the object at position *pos* in the struct sequence pointed to by "
"*p*. No bounds checking is performed."
msgstr "返回 *p* 所指向的结构序列中,位于 *pos* 处的对象。不需要进行边界检查。"
#: ../../c-api/tuple.rst:202
msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`."
msgstr ":c:func:`PyStructSequence_GetItem` 的宏版本。"
#: ../../c-api/tuple.rst:207
msgid ""
"Sets the field at index *pos* of the struct sequence *p* to value *o*. Like"
" :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand new "
"instances."
msgstr ""
"将结构序列 *p* 的索引 *pos* 处的字段设置为值 *o*。 与 :c:func:`PyTuple_SET_ITEM` "
"一样,它应该只用于填充全新的实例。"
#: ../../c-api/tuple.rst:213 ../../c-api/tuple.rst:222
msgid "This function \"steals\" a reference to *o*."
msgstr "这个函数“窃取”了指向 *o* 的一个引用。"
#: ../../c-api/tuple.rst:218
msgid "Macro equivalent of :c:func:`PyStructSequence_SetItem`."
msgstr ":c:func:`PyStructSequence_SetItem` 的宏版本。"