Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sync with cpython 5618c81e
  • Loading branch information
github-actions[bot] authored Nov 17, 2021
commit 955b050be8632ba4aa24a5f6114c5f3f831648a8
98 changes: 52 additions & 46 deletions library/asyncio-future.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-26 16:47+0000\n"
"POT-Creation-Date: 2021-11-17 00:09+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
Expand Down Expand Up @@ -88,251 +88,257 @@ msgid ""
msgstr ""

#: ../../library/asyncio-future.rst:57
msgid "The function accepts any :term:`awaitable` object."
msgid ""
"Save a reference to the result of this function, to avoid a task "
"disappearing mid execution."
msgstr ""

#: ../../library/asyncio-future.rst:60
msgid "The function accepts any :term:`awaitable` object."
msgstr ""

#: ../../library/asyncio-future.rst:63
msgid ""
"Deprecation warning is emitted if *obj* is not a Future-like object and "
"*loop* is not specified and there is no running event loop."
msgstr ""

#: ../../library/asyncio-future.rst:67
#: ../../library/asyncio-future.rst:70
msgid ""
"Wrap a :class:`concurrent.futures.Future` object in a :class:`asyncio."
"Future` object."
msgstr ""

#: ../../library/asyncio-future.rst:70
#: ../../library/asyncio-future.rst:73
msgid ""
"Deprecation warning is emitted if *future* is not a Future-like object and "
"*loop* is not specified and there is no running event loop."
msgstr ""

#: ../../library/asyncio-future.rst:76
#: ../../library/asyncio-future.rst:79
msgid "Future Object"
msgstr ""

#: ../../library/asyncio-future.rst:80
#: ../../library/asyncio-future.rst:83
msgid ""
"A Future represents an eventual result of an asynchronous operation. Not "
"thread-safe."
msgstr ""

#: ../../library/asyncio-future.rst:83
#: ../../library/asyncio-future.rst:86
msgid ""
"Future is an :term:`awaitable` object. Coroutines can await on Future "
"objects until they either have a result or an exception set, or until they "
"are cancelled."
msgstr ""

#: ../../library/asyncio-future.rst:87
#: ../../library/asyncio-future.rst:90
msgid ""
"Typically Futures are used to enable low-level callback-based code (e.g. in "
"protocols implemented using asyncio :ref:`transports <asyncio-transports-"
"protocols>`) to interoperate with high-level async/await code."
msgstr ""

#: ../../library/asyncio-future.rst:92
#: ../../library/asyncio-future.rst:95
msgid ""
"The rule of thumb is to never expose Future objects in user-facing APIs, and "
"the recommended way to create a Future object is to call :meth:`loop."
"create_future`. This way alternative event loop implementations can inject "
"their own optimized implementations of a Future object."
msgstr ""

#: ../../library/asyncio-future.rst:98
#: ../../library/asyncio-future.rst:101
msgid "Added support for the :mod:`contextvars` module."
msgstr ""

#: ../../library/asyncio-future.rst:101
#: ../../library/asyncio-future.rst:104
msgid ""
"Deprecation warning is emitted if *loop* is not specified and there is no "
"running event loop."
msgstr ""

#: ../../library/asyncio-future.rst:107
#: ../../library/asyncio-future.rst:110
msgid "Return the result of the Future."
msgstr ""

#: ../../library/asyncio-future.rst:109
#: ../../library/asyncio-future.rst:112
msgid ""
"If the Future is *done* and has a result set by the :meth:`set_result` "
"method, the result value is returned."
msgstr ""

#: ../../library/asyncio-future.rst:112
#: ../../library/asyncio-future.rst:115
msgid ""
"If the Future is *done* and has an exception set by the :meth:"
"`set_exception` method, this method raises the exception."
msgstr ""

#: ../../library/asyncio-future.rst:115 ../../library/asyncio-future.rst:203
#: ../../library/asyncio-future.rst:118 ../../library/asyncio-future.rst:206
msgid ""
"If the Future has been *cancelled*, this method raises a :exc:"
"`CancelledError` exception."
msgstr ""

#: ../../library/asyncio-future.rst:118
#: ../../library/asyncio-future.rst:121
msgid ""
"If the Future's result isn't yet available, this method raises a :exc:"
"`InvalidStateError` exception."
msgstr ""

#: ../../library/asyncio-future.rst:123
#: ../../library/asyncio-future.rst:126
msgid "Mark the Future as *done* and set its result."
msgstr ""

#: ../../library/asyncio-future.rst:125 ../../library/asyncio-future.rst:132
#: ../../library/asyncio-future.rst:128 ../../library/asyncio-future.rst:135
msgid ""
"Raises a :exc:`InvalidStateError` error if the Future is already *done*."
msgstr ""

#: ../../library/asyncio-future.rst:130
#: ../../library/asyncio-future.rst:133
msgid "Mark the Future as *done* and set an exception."
msgstr ""

#: ../../library/asyncio-future.rst:137
#: ../../library/asyncio-future.rst:140
msgid "Return ``True`` if the Future is *done*."
msgstr ""

#: ../../library/asyncio-future.rst:139
#: ../../library/asyncio-future.rst:142
msgid ""
"A Future is *done* if it was *cancelled* or if it has a result or an "
"exception set with :meth:`set_result` or :meth:`set_exception` calls."
msgstr ""

#: ../../library/asyncio-future.rst:145
#: ../../library/asyncio-future.rst:148
msgid "Return ``True`` if the Future was *cancelled*."
msgstr ""

#: ../../library/asyncio-future.rst:147
#: ../../library/asyncio-future.rst:150
msgid ""
"The method is usually used to check if a Future is not *cancelled* before "
"setting a result or an exception for it::"
msgstr ""

#: ../../library/asyncio-future.rst:155
#: ../../library/asyncio-future.rst:158
msgid "Add a callback to be run when the Future is *done*."
msgstr ""

#: ../../library/asyncio-future.rst:157
#: ../../library/asyncio-future.rst:160
msgid "The *callback* is called with the Future object as its only argument."
msgstr ""

#: ../../library/asyncio-future.rst:160
#: ../../library/asyncio-future.rst:163
msgid ""
"If the Future is already *done* when this method is called, the callback is "
"scheduled with :meth:`loop.call_soon`."
msgstr ""

#: ../../library/asyncio-future.rst:163
#: ../../library/asyncio-future.rst:166
msgid ""
"An optional keyword-only *context* argument allows specifying a custom :"
"class:`contextvars.Context` for the *callback* to run in. The current "
"context is used when no *context* is provided."
msgstr ""

#: ../../library/asyncio-future.rst:167
#: ../../library/asyncio-future.rst:170
msgid ""
":func:`functools.partial` can be used to pass parameters to the callback, e."
"g.::"
msgstr ""

#: ../../library/asyncio-future.rst:174
#: ../../library/asyncio-future.rst:177
msgid ""
"The *context* keyword-only parameter was added. See :pep:`567` for more "
"details."
msgstr ""

#: ../../library/asyncio-future.rst:180
#: ../../library/asyncio-future.rst:183
msgid "Remove *callback* from the callbacks list."
msgstr ""

#: ../../library/asyncio-future.rst:182
#: ../../library/asyncio-future.rst:185
msgid ""
"Returns the number of callbacks removed, which is typically 1, unless a "
"callback was added more than once."
msgstr ""

#: ../../library/asyncio-future.rst:187
#: ../../library/asyncio-future.rst:190
msgid "Cancel the Future and schedule callbacks."
msgstr ""

#: ../../library/asyncio-future.rst:189
#: ../../library/asyncio-future.rst:192
msgid ""
"If the Future is already *done* or *cancelled*, return ``False``. Otherwise, "
"change the Future's state to *cancelled*, schedule the callbacks, and return "
"``True``."
msgstr ""

#: ../../library/asyncio-future.rst:193
#: ../../library/asyncio-future.rst:196
msgid "Added the ``msg`` parameter."
msgstr ""

#: ../../library/asyncio-future.rst:198
#: ../../library/asyncio-future.rst:201
msgid "Return the exception that was set on this Future."
msgstr ""

#: ../../library/asyncio-future.rst:200
#: ../../library/asyncio-future.rst:203
msgid ""
"The exception (or ``None`` if no exception was set) is returned only if the "
"Future is *done*."
msgstr ""

#: ../../library/asyncio-future.rst:206
#: ../../library/asyncio-future.rst:209
msgid ""
"If the Future isn't *done* yet, this method raises an :exc:"
"`InvalidStateError` exception."
msgstr ""

#: ../../library/asyncio-future.rst:211
#: ../../library/asyncio-future.rst:214
msgid "Return the event loop the Future object is bound to."
msgstr ""

#: ../../library/asyncio-future.rst:218
#: ../../library/asyncio-future.rst:221
msgid ""
"This example creates a Future object, creates and schedules an asynchronous "
"Task to set result for the Future, and waits until the Future has a result::"
msgstr ""

#: ../../library/asyncio-future.rst:253
#: ../../library/asyncio-future.rst:256
msgid ""
"The Future object was designed to mimic :class:`concurrent.futures.Future`. "
"Key differences include:"
msgstr ""

#: ../../library/asyncio-future.rst:256
#: ../../library/asyncio-future.rst:259
msgid ""
"unlike asyncio Futures, :class:`concurrent.futures.Future` instances cannot "
"be awaited."
msgstr ""

#: ../../library/asyncio-future.rst:259
#: ../../library/asyncio-future.rst:262
msgid ""
":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` do not "
"accept the *timeout* argument."
msgstr ""

#: ../../library/asyncio-future.rst:262
#: ../../library/asyncio-future.rst:265
msgid ""
":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise an :"
"exc:`InvalidStateError` exception when the Future is not *done*."
msgstr ""

#: ../../library/asyncio-future.rst:266
#: ../../library/asyncio-future.rst:269
msgid ""
"Callbacks registered with :meth:`asyncio.Future.add_done_callback` are not "
"called immediately. They are scheduled with :meth:`loop.call_soon` instead."
msgstr ""

#: ../../library/asyncio-future.rst:270
#: ../../library/asyncio-future.rst:273
msgid ""
"asyncio Future is not compatible with the :func:`concurrent.futures.wait` "
"and :func:`concurrent.futures.as_completed` functions."
msgstr ""

#: ../../library/asyncio-future.rst:274
#: ../../library/asyncio-future.rst:277
msgid ""
":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but :"
"func:`concurrent.futures.cancel` does not."
Expand Down
Loading