@@ -476,20 +476,22 @@ msgid ""
476476"now be invoked when the new stack is closed (either explicitly or implicitly"
477477" at the end of a :keyword:`with` statement)."
478478msgstr ""
479+ "将回调栈传输到一个新的 :class:`ExitStack` 实例并返回它。 此操作不会发起调用任何回调 —— "
480+ "作为替代,现在当新栈被关闭时它们将(显式地或是在一条 :keyword:`with` 语句结束时隐式地)被发起调用。"
479481
480482#: ../../library/contextlib.rst:439
481483msgid ""
482484"For example, a group of files can be opened as an \" all or nothing\" "
483485"operation as follows::"
484- msgstr ""
486+ msgstr "例如,一组文件可以像下面这样以“一个都不能少”的操作方式被打开:: "
485487
486488#: ../../library/contextlib.rst:453
487489msgid ""
488490"Immediately unwinds the callback stack, invoking callbacks in the reverse "
489491"order of registration. For any context managers and exit callbacks "
490492"registered, the arguments passed in will indicate that no exception "
491493"occurred."
492- msgstr ""
494+ msgstr "立即展开回调栈,按注册时的相反顺序发起调用其中的回调。 对于任何已注册的上下文管理器和退出回调,传入的参数将表明没有发生异常。 "
493495
494496#: ../../library/contextlib.rst:460
495497msgid ""
@@ -498,6 +500,8 @@ msgid ""
498500"asynchronous context managers, as well as having coroutines for cleanup "
499501"logic."
500502msgstr ""
503+ "一个 :ref:`异步上下文管理器 <async-context-managers>`,类似于 "
504+ ":class:`ExitStack`,它支持组合同步和异步上下文管理器,并拥有针对清理逻辑的协程。"
501505
502506#: ../../library/contextlib.rst:465
503507msgid ""
@@ -537,7 +541,7 @@ msgstr "例子和配方"
537541msgid ""
538542"This section describes some examples and recipes for making effective use of"
539543" the tools provided by :mod:`contextlib`."
540- msgstr ""
544+ msgstr "本节描述了一些用于有效利用 :mod:`contextlib` 所提供的工具的示例和步骤。 "
541545
542546#: ../../library/contextlib.rst:505
543547msgid "Supporting a variable number of context managers"
0 commit comments