@@ -12,7 +12,7 @@ msgid ""
1212msgstr ""
1313"Project-Id-Version :Python 3.14\n "
1414"Report-Msgid-Bugs-To :\n "
15- "POT-Creation-Date :2025-11-03 14:20 +0000\n "
15+ "POT-Creation-Date :2025-11-07 14:15 +0000\n "
1616"PO-Revision-Date :2025-09-16 00:00+0000\n "
1717"Last-Translator :Freesand Leo <yuqinju@163.com>, 2025\n "
1818"Language-Team :Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -312,6 +312,10 @@ msgid ""
312312msgstr "返回字典中项目数,等价于对字典 *p* 使用 ``len(p)``。"
313313
314314#: ../../c-api/dict.rst:250
315+ msgid "Similar to :c:func:`PyDict_Size`, but without error checking."
316+ msgstr "类似于 :c:func:`PyDict_Size`,但是不带错误检查。"
317+
318+ #: ../../c-api/dict.rst:255
315319msgid ""
316320"Iterate over all key-value pairs in the dictionary *p*. The "
317321":c:type:`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` "
@@ -329,11 +333,11 @@ msgstr ""
329333":c:expr:`PyObject*` 变量,它们将分别使用每个键和值来填充,或者也可以为 ``NULL``。 通过它们返回的任何引用都是暂借的。 "
330334"*ppos* 在迭代期间不应被更改。 它的值表示内部字典结构中的偏移量,并且由于结构是稀疏的,因此偏移量并不连续。"
331335
332- #: ../../c-api/dict.rst:261
336+ #: ../../c-api/dict.rst:266
333337msgid "For example::"
334338msgstr "例如:"
335339
336- #: ../../c-api/dict.rst:263
340+ #: ../../c-api/dict.rst:268
337341msgid ""
338342"PyObject *key, *value;\n"
339343"Py_ssize_t pos = 0;\n"
@@ -351,14 +355,14 @@ msgstr ""
351355" ...\n"
352356"}"
353357
354- #: ../../c-api/dict.rst:271
358+ #: ../../c-api/dict.rst:276
355359msgid ""
356360"The dictionary *p* should not be mutated during iteration. It is safe to "
357361"modify the values of the keys as you iterate over the dictionary, but only "
358362"so long as the set of keys does not change. For example::"
359363msgstr "字典 *p* 不应该在遍历期间发生改变。在遍历字典时,改变键中的值是安全的,但仅限于键的集合不发生改变。例如::"
360364
361- #: ../../c-api/dict.rst:275
365+ #: ../../c-api/dict.rst:280
362366msgid ""
363367"PyObject *key, *value;\n"
364368"Py_ssize_t pos = 0;\n"
@@ -396,7 +400,7 @@ msgstr ""
396400" Py_DECREF(o);\n"
397401"}"
398402
399- #: ../../c-api/dict.rst:293
403+ #: ../../c-api/dict.rst:298
400404msgid ""
401405"The function is not thread-safe in the :term:`free-threaded <free "
402406"threading>` build without external synchronization. You can use "
@@ -406,7 +410,7 @@ msgstr ""
406410"此函数在没有外部同步的 :term:`自由线程 <free threading>` 编译版中不是线程安全的。 你可以使用 "
407411":c:macro:`Py_BEGIN_CRITICAL_SECTION` 在迭代字典时锁定它::"
408412
409- #: ../../c-api/dict.rst:298
413+ #: ../../c-api/dict.rst:303
410414msgid ""
411415"Py_BEGIN_CRITICAL_SECTION(self->dict);\n"
412416"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n"
@@ -420,7 +424,7 @@ msgstr ""
420424"}\n"
421425"Py_END_CRITICAL_SECTION();"
422426
423- #: ../../c-api/dict.rst:306
427+ #: ../../c-api/dict.rst:311
424428msgid ""
425429"On the free-threaded build, this function can be used safely inside a "
426430"critical section. However, the references returned for *pkey* and *pvalue* "
@@ -434,7 +438,7 @@ msgstr ""
434438"<borrowed reference>` 并且仅在关键节被持有时有效。 如果你需要在关键节之外或是在关键节可被挂起时使用这些对象,则要创建 "
435439":term:`强引用 <strong reference>` (例如,使用 :c:func:`Py_NewRef`)。"
436440
437- #: ../../c-api/dict.rst:316
441+ #: ../../c-api/dict.rst:321
438442msgid ""
439443"Iterate over mapping object *b* adding key-value pairs to dictionary *a*. "
440444"*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` "
@@ -447,7 +451,7 @@ msgstr ""
447451":c:func:`PyObject_GetItem` 的对象。 如果 *override* 为真值,则如果在 *b* 中找到相同的键则 *a* "
448452"中已存在的相应键值对将被替换,否则如果在 *a* 中没有相同的键则只是添加键值对。 当成功时返回 ``0`` 或者当引发异常时返回 ``-1``。"
449453
450- #: ../../c-api/dict.rst:326
454+ #: ../../c-api/dict.rst:331
451455msgid ""
452456"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to "
453457"``a.update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall "
@@ -459,7 +463,7 @@ msgstr ""
459463":c:func:`PyDict_Update` 在第二个参数没有\" keys\" 属性时不会回退到迭代键值对的序列。 当成功时返回 ``0`` "
460464"或者当引发异常时返回 ``-1``。"
461465
462- #: ../../c-api/dict.rst:335
466+ #: ../../c-api/dict.rst:340
463467msgid ""
464468"Update or merge into dictionary *a*, from the key-value pairs in *seq2*. "
465469"*seq2* must be an iterable object producing iterable objects of length 2, "
@@ -472,7 +476,7 @@ msgstr ""
472476"*override* 真值则最后出现的键胜出。 当成功时返回 ``0`` 或者当引发异常时返回 ``-1``。 等价的 Python "
473477"代码(返回值除外)::"
474478
475- #: ../../c-api/dict.rst:342
479+ #: ../../c-api/dict.rst:347
476480msgid ""
477481"def PyDict_MergeFromSeq2(a, seq2, override):\n"
478482" for key, value in seq2:\n"
@@ -484,7 +488,7 @@ msgstr ""
484488" if override or key not in a:\n"
485489" a[key] = value"
486490
487- #: ../../c-api/dict.rst:349
491+ #: ../../c-api/dict.rst:354
488492msgid ""
489493"Register *callback* as a dictionary watcher. Return a non-negative integer "
490494"id which must be passed to future calls to :c:func:`PyDict_Watch`. In case "
@@ -494,7 +498,7 @@ msgstr ""
494498"在字典上注册 *callback* 来作为 watcher。返回值为非负数的整数 id,作为将来调用 :c:func:`PyDict_Watch` "
495499"的时候使用。如果出现错误(比如没有足够的可用 watcher ID),返回 ``-1`` 并且设置异常。"
496500
497- #: ../../c-api/dict.rst:358
501+ #: ../../c-api/dict.rst:363
498502msgid ""
499503"Clear watcher identified by *watcher_id* previously returned from "
500504":c:func:`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. "
@@ -503,7 +507,7 @@ msgstr ""
503507"清空由之前从 :c:func:`PyDict_AddWatcher` 返回的 *watcher_id* 所标识的 watcher。 成功时返回 "
504508"``0``,出错时(例如当给定的 *watcher_id* 未被注册)返回 ``-1``。"
505509
506- #: ../../c-api/dict.rst:366
510+ #: ../../c-api/dict.rst:371
507511msgid ""
508512"Mark dictionary *dict* as watched. The callback granted *watcher_id* by "
509513":c:func:`PyDict_AddWatcher` will be called when *dict* is modified or "
@@ -512,7 +516,7 @@ msgstr ""
512516"将字典 *dict* 标记为已被监视。 由 :c:func:`PyDict_AddWatcher` 授权 *watcher_id* 对应的回调将在 "
513517"*dict* 被修改或释放时被调用。 成功时返回 ``0``,出错时返回 ``-1``。"
514518
515- #: ../../c-api/dict.rst:374
519+ #: ../../c-api/dict.rst:379
516520msgid ""
517521"Mark dictionary *dict* as no longer watched. The callback granted "
518522"*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when "
@@ -522,7 +526,7 @@ msgstr ""
522526"将字典 *dict* 标记为不再被监视。 由 :c:func:`PyDict_AddWatcher` 授权 *watcher_id* 对应的回调在 "
523527"*dict* 被修改或释放时将不再被调用。 该字典在此之前必须已被此监视器所监视。 成功时返回 ``0``,出错时返回 ``-1``。"
524528
525- #: ../../c-api/dict.rst:383
529+ #: ../../c-api/dict.rst:388
526530msgid ""
527531"Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, "
528532"``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, "
@@ -533,11 +537,11 @@ msgstr ""
533537"``PyDict_EVENT_DELETED``, ``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED`` "
534538"或 ``PyDict_EVENT_DEALLOCATED``。"
535539
536- #: ../../c-api/dict.rst:391
540+ #: ../../c-api/dict.rst:396
537541msgid "Type of a dict watcher callback function."
538542msgstr "字典监视器回调函数的类型。"
539543
540- #: ../../c-api/dict.rst:393
544+ #: ../../c-api/dict.rst:398
541545msgid ""
542546"If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both"
543547" *key* and *new_value* will be ``NULL``. If *event* is "
@@ -550,7 +554,7 @@ msgstr ""
550554"``PyDict_EVENT_MODIFIED``,则 *new_value* 将为 *key* 的新值。 如果 *event* 是 "
551555"``PyDict_EVENT_DELETED``,则将从字典中删除 *key* 而 *new_value* 将为 ``NULL``。"
552556
553- #: ../../c-api/dict.rst:399
557+ #: ../../c-api/dict.rst:404
554558msgid ""
555559"``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another "
556560"dict is merged into it. To maintain efficiency of this operation, per-key "
@@ -560,7 +564,7 @@ msgstr ""
560564"``PyDict_EVENT_CLONED`` 会在另一个字典合并到之前为空的 *dict* 时发生。 为保证此操作的效率,该场景不会发出针对单个键的 "
561565"``PyDict_EVENT_ADDED`` 事件;而是发出单个 ``PyDict_EVENT_CLONED``,而 *key* 将为源字典。"
562566
563- #: ../../c-api/dict.rst:405
567+ #: ../../c-api/dict.rst:410
564568msgid ""
565569"The callback may inspect but must not modify *dict*; doing so could have "
566570"unpredictable effects, including infinite recursion. Do not trigger Python "
@@ -570,7 +574,7 @@ msgstr ""
570574"该回调可以检查但不能修改 *dict*;否则会产生不可预料的影响,包括无限递归。 请不要在该回调中触发 Python 代码的执行,因为它可能产生修改 "
571575"dict 的附带影响。"
572576
573- #: ../../c-api/dict.rst:409
577+ #: ../../c-api/dict.rst:414
574578msgid ""
575579"If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the "
576580"callback to the about-to-be-destroyed dictionary will resurrect it and "
@@ -582,13 +586,13 @@ msgstr ""
582586"``PyDict_EVENT_DEALLOCATED``,则在回调中接受一个对即将销毁的字典的新引用将使其重生并阻止其在此时被释放。 "
583587"当重生的对象以后再被销毁时,任何在当时已激活的监视器回调将再次被调用。"
584588
585- #: ../../c-api/dict.rst:415
589+ #: ../../c-api/dict.rst:420
586590msgid ""
587591"Callbacks occur before the notified modification to *dict* takes place, so "
588592"the prior state of *dict* can be inspected."
589593msgstr "回调会在已通知的对 *dict* 的修改完成之前执行,这样在此之前的 *dict* 状态可以被检查。"
590594
591- #: ../../c-api/dict.rst:418
595+ #: ../../c-api/dict.rst:423
592596msgid ""
593597"If the callback sets an exception, it must return ``-1``; this exception "
594598"will be printed as an unraisable exception using "
@@ -597,7 +601,7 @@ msgstr ""
597601"如果该回调设置了一个异常,则它必须返回 ``-1``;此异常将作为不可引发的异常使用 :c:func:`PyErr_WriteUnraisable` "
598602"打印出来。 在其他情况下它应当返回 ``0``。"
599603
600- #: ../../c-api/dict.rst:422
604+ #: ../../c-api/dict.rst:427
601605msgid ""
602606"There may already be a pending exception set on entry to the callback. In "
603607"this case, the callback should return ``0`` with the same exception still "