@@ -16,7 +16,7 @@ msgid ""
1616msgstr ""
1717"Project-Id-Version : Python 3.12\n "
1818"Report-Msgid-Bugs-To : \n "
19- "POT-Creation-Date : 2023-07-21 14:13 +0000\n "
19+ "POT-Creation-Date : 2023-08-25 20:17 +0000\n "
2020"PO-Revision-Date : 2021-06-28 00:48+0000\n "
2121"
Last-Translator :
Freesand Leo <[email protected] >, 2023\n "
2222"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -96,13 +96,10 @@ msgstr ""
9696#: ../../c-api/dict.rst:75
9797msgid ""
9898"Insert *val* into the dictionary *p* using *key* as a key. *key* should be a"
99- " :c:expr:`const char*`. The key object is created using "
100- "``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on "
101- "failure. This function *does not* steal a reference to *val*."
99+ " :c:expr:`const char*` UTF-8 encoded bytes string . The key object is "
100+ "created using ``PyUnicode_FromString(key)``. Return ``0`` on success or "
101+ "``-1`` on failure. This function *does not* steal a reference to *val*."
102102msgstr ""
103- "使用 *key* 作为键将 *val* 插入到字典 *p* 中。 *key* 应为 :c:expr:`const char*`。 键对象是使用 "
104- "``PyUnicode_FromString(key)`` 创建的。成功时返回 ``0``,失败时返回 ``-1``。 此函数 *不会* 窃取对 "
105- "*val* 的引用。"
106103
107104#: ../../c-api/dict.rst:83
108105msgid ""
@@ -117,21 +114,19 @@ msgstr ""
117114
118115#: ../../c-api/dict.rst:91
119116msgid ""
120- "Remove the entry in dictionary *p* which has a key specified by the string "
121- "*key*. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return "
122- "``0`` on success or ``-1`` on failure."
117+ "Remove the entry in dictionary *p* which has a key specified by the UTF-8 "
118+ "encoded bytes string *key*. If *key* is not in the dictionary, "
119+ ":exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on failure."
123120msgstr ""
124- "移除字典 *p* 中由字符串 *key* 指定的键的条目。 如果字典中没有 *key*,则会引发 :exc:`KeyError`。 成功时返回 "
125- "``0``,失败时返回 ``-1``。"
126121
127- #: ../../c-api/dict.rst:98
122+ #: ../../c-api/dict.rst:99
128123msgid ""
129124"Return the object from dictionary *p* which has a key *key*. Return "
130125"``NULL`` if the key *key* is not present, but *without* setting an "
131126"exception."
132127msgstr "从字典 *p* 中返回以 *key* 为键的对象。 如果键名 *key* 不存在但 *没有* 设置一个异常则返回 ``NULL``。"
133128
134- #: ../../c-api/dict.rst:103
129+ #: ../../c-api/dict.rst:104
135130msgid ""
136131"Exceptions that occur while this calls :meth:`~object.__hash__` and "
137132":meth:`~object.__eq__` methods are silently ignored. Prefer the "
@@ -140,13 +135,13 @@ msgstr ""
140135"在调用 :meth:`~object.__hash__` 和 :meth:`~object.__eq__` 方法时发生的异常将被静默地忽略。 建议改用 "
141136":c:func:`PyDict_GetItemWithError` 函数。"
142137
143- #: ../../c-api/dict.rst:107
138+ #: ../../c-api/dict.rst:108
144139msgid ""
145140"Calling this API without :term:`GIL` held had been allowed for historical "
146141"reason. It is no longer allowed."
147142msgstr "在不保持 :term:`GIL` 的情况下调用此 API 曾因历史原因而被允许。 现在已不再被允许。"
148143
149- #: ../../c-api/dict.rst:114
144+ #: ../../c-api/dict.rst:115
150145msgid ""
151146"Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. "
152147"Return ``NULL`` **with** an exception set if an exception occurred. Return "
@@ -155,15 +150,14 @@ msgstr ""
155150":c:func:`PyDict_GetItem` 的变种,它不会屏蔽异常。 当异常发生时将返回 ``NULL`` **并且** 设置一个异常。 "
156151"如果键不存在则返回 ``NULL`` **并且不会** 设置一个异常。"
157152
158- #: ../../c-api/dict.rst:122
153+ #: ../../c-api/dict.rst:123
159154msgid ""
160155"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a "
161- ":c:expr:`const char*`, rather than a :c:expr:`PyObject*`."
156+ ":c:expr:`const char*` UTF-8 encoded bytes string, rather than a "
157+ ":c:expr:`PyObject*`."
162158msgstr ""
163- "这与 :c:func:`PyDict_GetItem` 一样,但是 *key* 被指定为 :c:expr:`const char*`,而不是 "
164- ":c:expr:`PyObject*`。"
165159
166- #: ../../c-api/dict.rst:127
160+ #: ../../c-api/dict.rst:129
167161msgid ""
168162"Exceptions that occur while this calls :meth:`~object.__hash__` and "
169163":meth:`~object.__eq__` methods or while creating the temporary :class:`str` "
@@ -175,7 +169,7 @@ msgstr ""
175169":class:`str` 对象期间发生的异常将被静默地忽略。 建议改用 :c:func:`PyDict_GetItemWithError` "
176170"函数并附带你自己的 :c:func:`PyUnicode_FromString` *key*。"
177171
178- #: ../../c-api/dict.rst:136
172+ #: ../../c-api/dict.rst:138
179173msgid ""
180174"This is the same as the Python-level :meth:`dict.setdefault`. If present, "
181175"it returns the value corresponding to *key* from the dictionary *p*. If the"
@@ -188,30 +182,30 @@ msgstr ""
188182"里面对应的值。如果键不存在,它会和值 *defaultobj* 一起插入并返回 *defaultobj* 。这个函数只计算 *key* "
189183"的哈希函数一次,而不是在查找和插入时分别计算它。"
190184
191- #: ../../c-api/dict.rst:146
185+ #: ../../c-api/dict.rst:148
192186msgid ""
193187"Return a :c:type:`PyListObject` containing all the items from the "
194188"dictionary."
195189msgstr "返回一个包含字典中所有键值项的 :c:type:`PyListObject`。"
196190
197- #: ../../c-api/dict.rst:151
191+ #: ../../c-api/dict.rst:153
198192msgid ""
199193"Return a :c:type:`PyListObject` containing all the keys from the dictionary."
200194msgstr "返回一个包含字典中所有键(keys)的 :c:type:`PyListObject`。"
201195
202- #: ../../c-api/dict.rst:156
196+ #: ../../c-api/dict.rst:158
203197msgid ""
204198"Return a :c:type:`PyListObject` containing all the values from the "
205199"dictionary *p*."
206200msgstr "返回一个包含字典中所有值(values)的 :c:type:`PyListObject`。"
207201
208- #: ../../c-api/dict.rst:164
202+ #: ../../c-api/dict.rst:166
209203msgid ""
210204"Return the number of items in the dictionary. This is equivalent to "
211205"``len(p)`` on a dictionary."
212206msgstr "返回字典中项目数,等价于对字典 *p* 使用 ``len(p)``。"
213207
214- #: ../../c-api/dict.rst:170
208+ #: ../../c-api/dict.rst:172
215209msgid ""
216210"Iterate over all key-value pairs in the dictionary *p*. The "
217211":c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` "
@@ -229,18 +223,18 @@ msgstr ""
229223":c:expr:`PyObject*` 变量,它们将分别使用每个键和值来填充,或者也可以为 ``NULL``。 通过它们返回的任何引用都是暂借的。 "
230224"*ppos* 在迭代期间不应被更改。 它的值表示内部字典结构中的偏移量,并且由于结构是稀疏的,因此偏移量并不连续。"
231225
232- #: ../../c-api/dict.rst:181
226+ #: ../../c-api/dict.rst:183
233227msgid "For example::"
234228msgstr "例如:"
235229
236- #: ../../c-api/dict.rst:191
230+ #: ../../c-api/dict.rst:193
237231msgid ""
238232"The dictionary *p* should not be mutated during iteration. It is safe to "
239233"modify the values of the keys as you iterate over the dictionary, but only "
240234"so long as the set of keys does not change. For example::"
241235msgstr "字典 *p* 不应该在遍历期间发生改变。在遍历字典时,改变键中的值是安全的,但仅限于键的集合不发生改变。例如::"
242236
243- #: ../../c-api/dict.rst:216
237+ #: ../../c-api/dict.rst:218
244238msgid ""
245239"Iterate over mapping object *b* adding key-value pairs to dictionary *a*. "
246240"*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` "
@@ -253,7 +247,7 @@ msgstr ""
253247":c:func:`PyObject_GetItem` 的对象。 如果 *override* 为真值,则如果在 *b* 中找到相同的键则 *a* "
254248"中已存在的相应键值对将被替换,否则如果在 *a* 中没有相同的键则只是添加键值对。 当成功时返回 ``0`` 或者当引发异常时返回 ``-1``。"
255249
256- #: ../../c-api/dict.rst:226
250+ #: ../../c-api/dict.rst:228
257251msgid ""
258252"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to "
259253"``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall "
@@ -265,7 +259,7 @@ msgstr ""
265259":c:func:`PyDict_Update` 在第二个参数没有 \" keys\" 属性时不会回退到迭代键值对的序列。 当成功时返回 ``0`` "
266260"或者当引发异常时返回 ``-1``。"
267261
268- #: ../../c-api/dict.rst:235
262+ #: ../../c-api/dict.rst:237
269263msgid ""
270264"Update or merge into dictionary *a*, from the key-value pairs in *seq2*. "
271265"*seq2* must be an iterable object producing iterable objects of length 2, "
@@ -278,7 +272,7 @@ msgstr ""
278272"*override* 真值则最后出现的键胜出。 当成功时返回 ``0`` 或者当引发异常时返回 ``-1``。 等价的 Python "
279273"代码(返回值除外)::"
280274
281- #: ../../c-api/dict.rst:249
275+ #: ../../c-api/dict.rst:251
282276msgid ""
283277"Register *callback* as a dictionary watcher. Return a non-negative integer "
284278"id which must be passed to future calls to :c:func:`PyDict_Watch`. In case "
@@ -288,7 +282,7 @@ msgstr ""
288282"在字典上注册 *callback* 来作为 watcher。返回值为非负数的整数 id,作为将来调用 :c:func:`PyDict_Watch` "
289283"的时候使用。如果出现错误(比如没有足够的可用 watcher ID),返回 ``-1`` 并且设置异常。"
290284
291- #: ../../c-api/dict.rst:258
285+ #: ../../c-api/dict.rst:260
292286msgid ""
293287"Clear watcher identified by *watcher_id* previously returned from "
294288":c:func:`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. "
@@ -297,7 +291,7 @@ msgstr ""
297291"清空由之前从 :c:func:`PyDict_AddWatcher` 返回的 *watcher_id* 所标识的 watcher。 成功时返回 "
298292"``0``,出错时(例如当给定的 *watcher_id* 未被注册)返回 ``-1``。"
299293
300- #: ../../c-api/dict.rst:266
294+ #: ../../c-api/dict.rst:268
301295msgid ""
302296"Mark dictionary *dict* as watched. The callback granted *watcher_id* by "
303297":c:func:`PyDict_AddWatcher` will be called when *dict* is modified or "
@@ -306,7 +300,7 @@ msgstr ""
306300"将字典 *dict* 标记为已被监视。 由 :c:func:`PyDict_AddWatcher` 授权 *watcher_id* 对应的回调将在 "
307301"*dict* 被修改或释放时被调用。 成功时返回 ``0``,出错时返回 ``-1``。"
308302
309- #: ../../c-api/dict.rst:274
303+ #: ../../c-api/dict.rst:276
310304msgid ""
311305"Mark dictionary *dict* as no longer watched. The callback granted "
312306"*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when "
@@ -316,7 +310,7 @@ msgstr ""
316310"将字典 *dict* 标记为不再被监视。 由 :c:func:`PyDict_AddWatcher` 授权 *watcher_id* 对应的回调在 "
317311"*dict* 被修改或释放时将不再被调用。 该字典在此之前必须已被此监视器所监视。 成功时返回 ``0``,出错时返回 ``-1``。"
318312
319- #: ../../c-api/dict.rst:283
313+ #: ../../c-api/dict.rst:285
320314msgid ""
321315"Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, "
322316"``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, "
@@ -327,11 +321,11 @@ msgstr ""
327321"``PyDict_EVENT_DELETED``, ``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED`` "
328322"或 ``PyDict_EVENT_DEALLOCATED``。"
329323
330- #: ../../c-api/dict.rst:291
324+ #: ../../c-api/dict.rst:293
331325msgid "Type of a dict watcher callback function."
332326msgstr "字典监视器回调函数的类型。"
333327
334- #: ../../c-api/dict.rst:293
328+ #: ../../c-api/dict.rst:295
335329msgid ""
336330"If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both"
337331" *key* and *new_value* will be ``NULL``. If *event* is "
@@ -344,7 +338,7 @@ msgstr ""
344338"``PyDict_EVENT_MODIFIED``,则 *new_value* 将为 *key* 的新值。 如果 *event* 是 "
345339"``PyDict_EVENT_DELETED``,则将从字典中删除 *key* 而 *new_value* 将为 ``NULL``。"
346340
347- #: ../../c-api/dict.rst:299
341+ #: ../../c-api/dict.rst:301
348342msgid ""
349343"``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another "
350344"dict is merged into it. To maintain efficiency of this operation, per-key "
@@ -354,7 +348,7 @@ msgstr ""
354348"``PyDict_EVENT_CLONED`` 会在另一个字典合并到之前为空的 *dict* 时发生。 为保证此操作的效率,该场景不会发出针对单个键的 "
355349"``PyDict_EVENT_ADDED`` 事件;而是发出单个 ``PyDict_EVENT_CLONED``,而 *key* 将为源字典。"
356350
357- #: ../../c-api/dict.rst:305
351+ #: ../../c-api/dict.rst:307
358352msgid ""
359353"The callback may inspect but must not modify *dict*; doing so could have "
360354"unpredictable effects, including infinite recursion. Do not trigger Python "
@@ -364,7 +358,7 @@ msgstr ""
364358"该回调可以检查但不能修改 *dict*;否则会产生不可预料的影响,包括无限递归。 请不要在该回调中触发 Python 代码的执行,因为它可能产生修改 "
365359"dict 的附带影响。"
366360
367- #: ../../c-api/dict.rst:309
361+ #: ../../c-api/dict.rst:311
368362msgid ""
369363"If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the "
370364"callback to the about-to-be-destroyed dictionary will resurrect it and "
@@ -376,13 +370,13 @@ msgstr ""
376370"``PyDict_EVENT_DEALLOCATED``,则在回调中接受一个对即将销毁的字典的新引用将使其重生并阻止其在此时被释放。 "
377371"当重生的对象以后再被销毁时,任何在当时已激活的监视器回调将再次被调用。"
378372
379- #: ../../c-api/dict.rst:315
373+ #: ../../c-api/dict.rst:317
380374msgid ""
381375"Callbacks occur before the notified modification to *dict* takes place, so "
382376"the prior state of *dict* can be inspected."
383377msgstr "回调会在已通知的对 *dict* 的修改完成之前执行,这样在此之前的 *dict* 状态可以被检查。"
384378
385- #: ../../c-api/dict.rst:318
379+ #: ../../c-api/dict.rst:320
386380msgid ""
387381"If the callback sets an exception, it must return ``-1``; this exception "
388382"will be printed as an unraisable exception using "
@@ -391,7 +385,7 @@ msgstr ""
391385"如果该回调设置了一个异常,则它必须返回 ``-1``;此异常将作为不可引发的异常使用 :c:func:`PyErr_WriteUnraisable` "
392386"打印出来。 在其他情况下它应当返回 ``0``。"
393387
394- #: ../../c-api/dict.rst:322
388+ #: ../../c-api/dict.rst:324
395389msgid ""
396390"There may already be a pending exception set on entry to the callback. In "
397391"this case, the callback should return ``0`` with the same exception still "
@@ -414,10 +408,10 @@ msgstr "dictionary -- 字典"
414408msgid "PyUnicode_FromString()"
415409msgstr "PyUnicode_FromString()"
416410
417- #: ../../c-api/dict.rst:162
411+ #: ../../c-api/dict.rst:164
418412msgid "built-in function"
419413msgstr "内置函数"
420414
421- #: ../../c-api/dict.rst:162
415+ #: ../../c-api/dict.rst:164
422416msgid "len"
423417msgstr "len"
0 commit comments