1010# jaystone776 <[email protected] >, 20211111# Heyi Tang <[email protected] >, 20211212# Freesand Leo <[email protected] >, 202213+ # Nyuan Zhang, 2022
1314#
1415#, fuzzy
1516msgid ""
@@ -18,7 +19,7 @@ msgstr ""
1819"Report-Msgid-Bugs-To : \n "
1920"POT-Creation-Date : 2022-06-16 06:28+0000\n "
2021"PO-Revision-Date : 2021-06-28 00:57+0000\n "
21- "
Last-Translator :
Freesand Leo <[email protected] > , 2022\n"
22+ "Last-Translator : Nyuan Zhang , 2022\n "
2223"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2324"MIME-Version : 1.0\n "
2425"Content-Type : text/plain; charset=UTF-8\n "
@@ -183,6 +184,8 @@ msgid ""
183184"Context managers defined with :func:`asynccontextmanager` can be used either"
184185" as decorators or with :keyword:`async with` statements::"
185186msgstr ""
187+ "使用 :func:`asynccontextmanager` 定义的上下文管理器可以用作装饰器,也可以在 :keyword:`async with` "
188+ "语句中使用。"
186189
187190#: ../../library/contextlib.rst:147
188191msgid ""
@@ -191,12 +194,14 @@ msgid ""
191194"created by :func:`asynccontextmanager` to meet the requirement that context "
192195"managers support multiple invocations in order to be used as decorators."
193196msgstr ""
197+ "用作装饰器时,每次函数调用都会隐式创建一个新的生成器实例。这使得由 :func:`asynccontextmanager` 创建的 “一次性” "
198+ "上下文管理器能够满足作为装饰器所需要的支持多次调用的要求。"
194199
195200#: ../../library/contextlib.rst:152
196201msgid ""
197202"Async context managers created with :func:`asynccontextmanager` can be used "
198203"as decorators."
199- msgstr ""
204+ msgstr "使用 :func:`asynccontextmanager` 创建的异步上下文管理器可以用作装饰器。 "
200205
201206#: ../../library/contextlib.rst:159
202207msgid ""
@@ -220,7 +225,7 @@ msgstr ""
220225msgid ""
221226"Return an async context manager that calls the ``aclose()`` method of "
222227"*thing* upon completion of the block. This is basically equivalent to::"
223- msgstr ""
228+ msgstr "返回一个在语句块执行完成时调用 ``aclose()`` 方法来关闭 *things* 的异步上下文管理器。这基本上等价于: "
224229
225230#: ../../library/contextlib.rst:198
226231msgid ""
@@ -255,6 +260,7 @@ msgid ""
255260"It can also be used as a stand-in for :ref:`asynchronous context managers "
256261"<async-context-managers>`::"
257262msgstr ""
263+ "它也可以替代 :ref:`asynchronous context managers <async-context-managers>` :"
258264
259265#: ../../library/contextlib.rst:264
260266msgid ":term:`asynchronous context manager` support was added."
@@ -557,27 +563,27 @@ msgstr ""
557563msgid ""
558564"The :meth:`close` method is not implemented, :meth:`aclose` must be used "
559565"instead."
560- msgstr ""
566+ msgstr ":meth:`close` 方法没有被实现,使用 :meth:`aclose` 替代。 "
561567
562568#: ../../library/contextlib.rst:590
563569msgid ""
564570"Similar to :meth:`enter_context` but expects an asynchronous context "
565571"manager."
566- msgstr ""
572+ msgstr "与 :meth:`enter_context` 相近,但是需要一个异步上下文管理器。 "
567573
568574#: ../../library/contextlib.rst:595
569575msgid ""
570576"Similar to :meth:`push` but expects either an asynchronous context manager "
571577"or a coroutine function."
572- msgstr ""
578+ msgstr "与 :meth:`push` 相近,但是需要一个异步上下文管理器或协程函数。 "
573579
574580#: ../../library/contextlib.rst:600
575581msgid "Similar to :meth:`callback` but expects a coroutine function."
576- msgstr ""
582+ msgstr "与 :meth:`callback` 相近,但是需要一个协程函数。 "
577583
578584#: ../../library/contextlib.rst:604
579585msgid "Similar to :meth:`close` but properly handles awaitables."
580- msgstr ""
586+ msgstr "和 :meth:`close` 相近,但是它正确处理了可等待对象。 "
581587
582588#: ../../library/contextlib.rst:606
583589msgid "Continuing the example for :func:`asynccontextmanager`::"
@@ -616,7 +622,7 @@ msgstr ""
616622
617623#: ../../library/contextlib.rst:648
618624msgid "Catching exceptions from ``__enter__`` methods"
619- msgstr ""
625+ msgstr "捕获 ``__enter__`` 方法产生的异常 "
620626
621627#: ../../library/contextlib.rst:650
622628msgid ""
@@ -640,7 +646,7 @@ msgstr ""
640646
641647#: ../../library/contextlib.rst:675
642648msgid "Cleaning up in an ``__enter__`` implementation"
643- msgstr ""
649+ msgstr "在一个 ``__enter__`` 方法的实现中进行清理 "
644650
645651#: ../../library/contextlib.rst:677
646652msgid ""
@@ -710,13 +716,13 @@ msgstr ""
710716
711717#: ../../library/contextlib.rst:795
712718msgid "Using a context manager as a function decorator"
713- msgstr ""
719+ msgstr "将上下文管理器作为函数装饰器使用 "
714720
715721#: ../../library/contextlib.rst:797
716722msgid ""
717723":class:`ContextDecorator` makes it possible to use a context manager in both"
718724" an ordinary ``with`` statement and also as a function decorator."
719- msgstr ""
725+ msgstr ":class:`ContextDecorator` 类允许将上下文管理器作为函数装饰器使用,而不仅在 ``with`` 语句块中使用。 "
720726
721727#: ../../library/contextlib.rst:800
722728msgid ""
@@ -729,11 +735,11 @@ msgstr ""
729735
730736#: ../../library/contextlib.rst:821
731737msgid "Instances of this class can be used as both a context manager::"
732- msgstr ""
738+ msgstr "这个类的实例既可以被用作上下文管理器: "
733739
734740#: ../../library/contextlib.rst:827
735741msgid "And also as a function decorator::"
736- msgstr ""
742+ msgstr "也可以被用作函数装饰器: "
737743
738744#: ../../library/contextlib.rst:834
739745msgid ""
@@ -742,6 +748,8 @@ msgid ""
742748":meth:`__enter__`. If that value is needed, then it is still necessary to "
743749"use an explicit ``with`` statement."
744750msgstr ""
751+ "使用上下文管理器作为函数装饰器时,有一个额外限制:没有办法得到 :meth:`__enter__` 的返回值。如果需要返回值,你仍然需要显式使用 "
752+ "``with`` 语句。"
745753
746754#: ../../library/contextlib.rst:842
747755msgid ":pep:`343` - The \" with\" statement"
0 commit comments