@@ -13,7 +13,7 @@ msgid ""
1313msgstr ""
1414"Project-Id-Version : Python 3.14\n "
1515"Report-Msgid-Bugs-To : \n "
16- "POT-Creation-Date : 2026-03-25 14:54 +0000\n "
16+ "POT-Creation-Date : 2026-03-27 14:44 +0000\n "
1717"PO-Revision-Date : 2025-09-16 00:00+0000\n "
1818"Last-Translator : Freesand Leo <yuqinju@163.com>, 2026\n "
1919"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -480,11 +480,11 @@ msgid ""
480480"Writing correct and efficient asyncio code requires awareness of certain "
481481"pitfalls. This section outlines essential best practices that can save you "
482482"hours of debugging."
483- msgstr ""
483+ msgstr "要编写正确且高效的 asyncio 代码就必须注意某些陷阱。 本节概述了可为您节省大量调试时间的关键最佳实践。 "
484484
485485#: ../../library/asyncio-dev.rst:261
486486msgid "Close asynchronous generators explicitly"
487- msgstr ""
487+ msgstr "显式地关闭异步生成器 "
488488
489489#: ../../library/asyncio-dev.rst:263
490490msgid ""
@@ -662,6 +662,19 @@ msgid ""
662662" print(runner.run(anext(agen)))\n"
663663" del agen"
664664msgstr ""
665+ "import asyncio\n"
666+ "\n"
667+ "async def agenfn():\n"
668+ " try:\n"
669+ " yield 10\n"
670+ " finally:\n"
671+ " await asyncio.sleep(0)\n"
672+ "\n"
673+ "\n"
674+ "with asyncio.Runner() as runner:\n"
675+ " agen = agenfn()\n"
676+ " print(runner.run(anext(agen)))\n"
677+ " del agen"
665678
666679#: ../../library/asyncio-dev.rst:395
667680msgid ""
@@ -673,10 +686,17 @@ msgid ""
673686" ^^^^\n"
674687"RuntimeError: async generator ignored GeneratorExit"
675688msgstr ""
689+ "10\n"
690+ "Exception ignored while closing generator <async_generator object agenfn at 0x000002F71CD10D70>:\n"
691+ "Traceback (most recent call last):\n"
692+ " File \" example.py\" , line 13, in <module>\n"
693+ " del agen\n"
694+ " ^^^^\n"
695+ "RuntimeError: async generator ignored GeneratorExit"
676696
677697#: ../../library/asyncio-dev.rst:403
678698msgid "This example can be fixed as follows::"
679- msgstr ""
699+ msgstr "该示例可用以下方式修复:: "
680700
681701#: ../../library/asyncio-dev.rst:405
682702msgid ""
@@ -695,17 +715,33 @@ msgid ""
695715"\n"
696716"asyncio.run(main())"
697717msgstr ""
718+ "import asyncio\n"
719+ "\n"
720+ "async def agenfn():\n"
721+ " try:\n"
722+ " yield 10\n"
723+ " finally:\n"
724+ " await asyncio.sleep(0)\n"
725+ "\n"
726+ "async def main():\n"
727+ " agen = agenfn()\n"
728+ " print(await anext(agen))\n"
729+ " del agen\n"
730+ "\n"
731+ "asyncio.run(main())"
698732
699733#: ../../library/asyncio-dev.rst:422
700734msgid "Avoid concurrent iteration and closure of the same generator"
701- msgstr ""
735+ msgstr "避免同一迭代器的并发迭代和闭包 "
702736
703737#: ../../library/asyncio-dev.rst:424
704738msgid ""
705739"Async generators may be reentered while another :meth:`~agen.__anext__` / "
706740":meth:`~agen.athrow` / :meth:`~agen.aclose` call is in progress. This may "
707741"lead to an inconsistent state of the async generator and can cause errors."
708742msgstr ""
743+ "异步生成器可以在其他 :meth:`~agen.__anext__` / :meth:`~agen.athrow` / "
744+ ":meth:`~agen.aclose` 调用正在进行时重新进入。 这可能导致异步生成器状态不一致并造成错误。"
709745
710746#: ../../library/asyncio-dev.rst:429
711747msgid "Let's consider the following example::"
0 commit comments