# Copyright (C) 2001-2018, Python Software Foundation # For licence information, see README file. # msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-11-29 16:06+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: FRENCH \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../Doc/library/asyncio-future.rst:8 msgid "Futures" msgstr "" #: ../Doc/library/asyncio-future.rst:10 msgid "" "*Future* objects are used to bridge **low-level callback-based code** with " "high-level async/await code." msgstr "" #: ../Doc/library/asyncio-future.rst:15 msgid "Future Functions" msgstr "" #: ../Doc/library/asyncio-future.rst:19 msgid "Return ``True`` if *obj* is either of:" msgstr "" #: ../Doc/library/asyncio-future.rst:21 msgid "an instance of :class:`asyncio.Future`," msgstr "" #: ../Doc/library/asyncio-future.rst:22 msgid "an instance of :class:`asyncio.Task`," msgstr "" #: ../Doc/library/asyncio-future.rst:23 msgid "a Future-like object with a ``_asyncio_future_blocking`` attribute." msgstr "" #: ../Doc/library/asyncio-future.rst:31 msgid "Return:" msgstr "" #: ../Doc/library/asyncio-future.rst:33 msgid "" "*obj* argument as is, if *obj* is a :class:`Future`, a :class:`Task`, or a " "Future-like object (:func:`isfuture` is used for the test.)" msgstr "" #: ../Doc/library/asyncio-future.rst:37 msgid "" "a :class:`Task` object wrapping *obj*, if *obj* is a coroutine (:func:" "`iscoroutine` is used for the test.)" msgstr "" #: ../Doc/library/asyncio-future.rst:40 msgid "" "a :class:`Task` object that would await on *obj*, if *obj* is an awaitable (:" "func:`inspect.isawaitable` is used for the test.)" msgstr "" #: ../Doc/library/asyncio-future.rst:43 msgid "If *obj* is neither of the above a :exc:`TypeError` is raised." msgstr "" #: ../Doc/library/asyncio-future.rst:47 msgid "" "See also the :func:`create_task` function which is the preferred way for " "creating new Tasks." msgstr "" #: ../Doc/library/asyncio-future.rst:50 msgid "The function accepts any :term:`awaitable` object." msgstr "La fonction accepte n'importe quel objet :term:`awaitable`." #: ../Doc/library/asyncio-future.rst:56 msgid "" "Wrap a :class:`concurrent.futures.Future` object in a :class:`asyncio." "Future` object." msgstr "" #: ../Doc/library/asyncio-future.rst:61 msgid "Future Object" msgstr "" #: ../Doc/library/asyncio-future.rst:65 msgid "" "A Future represents an eventual result of an asynchronous operation. Not " "thread-safe." msgstr "" #: ../Doc/library/asyncio-future.rst:68 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 "" #: ../Doc/library/asyncio-future.rst:72 msgid "" "Typically Futures are used to enable low-level callback-based code (e.g. in " "protocols implemented using asyncio :ref:`transports `) to interoperate with high-level async/await code." msgstr "" #: ../Doc/library/asyncio-future.rst:77 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 "" #: ../Doc/library/asyncio-future.rst:83 msgid "Added support for the :mod:`contextvars` module." msgstr "" #: ../Doc/library/asyncio-future.rst:88 msgid "Return the result of the Future." msgstr "" #: ../Doc/library/asyncio-future.rst:90 msgid "" "If the Future is *done* and has a result set by the :meth:`set_result` " "method, the result value is returned." msgstr "" #: ../Doc/library/asyncio-future.rst:93 msgid "" "If the Future is *done* and has an exception set by the :meth:" "`set_exception` method, this method raises the exception." msgstr "" #: ../Doc/library/asyncio-future.rst:96 ../Doc/library/asyncio-future.rst:181 msgid "" "If the Future has been *cancelled*, this method raises a :exc:" "`CancelledError` exception." msgstr "" #: ../Doc/library/asyncio-future.rst:99 msgid "" "If the Future's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" #: ../Doc/library/asyncio-future.rst:104 msgid "Mark the Future as *done* and set its result." msgstr "" #: ../Doc/library/asyncio-future.rst:106 ../Doc/library/asyncio-future.rst:113 msgid "" "Raises a :exc:`InvalidStateError` error if the Future is already *done*." msgstr "" #: ../Doc/library/asyncio-future.rst:111 msgid "Mark the Future as *done* and set an exception." msgstr "" #: ../Doc/library/asyncio-future.rst:118 msgid "Return ``True`` if the Future is *done*." msgstr "" #: ../Doc/library/asyncio-future.rst:120 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 "" #: ../Doc/library/asyncio-future.rst:126 msgid "Return ``True`` if the Future was *cancelled*." msgstr "" #: ../Doc/library/asyncio-future.rst:128 msgid "" "The method is usually used to check if a Future is not *cancelled* before " "setting a result or an exception for it::" msgstr "" #: ../Doc/library/asyncio-future.rst:136 msgid "Add a callback to be run when the Future is *done*." msgstr "" #: ../Doc/library/asyncio-future.rst:138 msgid "The *callback* is called with the Future object as its only argument." msgstr "" #: ../Doc/library/asyncio-future.rst:141 msgid "" "If the Future is already *done* when this method is called, the callback is " "scheduled with :meth:`loop.call_soon`." msgstr "" #: ../Doc/library/asyncio-future.rst:144 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 "" #: ../Doc/library/asyncio-future.rst:148 msgid "" ":func:`functools.partial` can be used to pass parameters to the callback, e." "g.::" msgstr "" #: ../Doc/library/asyncio-future.rst:155 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" #: ../Doc/library/asyncio-future.rst:161 msgid "Remove *callback* from the callbacks list." msgstr "" #: ../Doc/library/asyncio-future.rst:163 msgid "" "Returns the number of callbacks removed, which is typically 1, unless a " "callback was added more than once." msgstr "" #: ../Doc/library/asyncio-future.rst:168 msgid "Cancel the Future and schedule callbacks." msgstr "" #: ../Doc/library/asyncio-future.rst:170 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 "" #: ../Doc/library/asyncio-future.rst:176 msgid "Return the exception that was set on this Future." msgstr "" #: ../Doc/library/asyncio-future.rst:178 msgid "" "The exception (or ``None`` if no exception was set) is returned only if the " "Future is *done*." msgstr "" #: ../Doc/library/asyncio-future.rst:184 msgid "" "If the Future isn't *done* yet, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" #: ../Doc/library/asyncio-future.rst:189 msgid "Return the event loop the Future object is bound to." msgstr "" #: ../Doc/library/asyncio-future.rst:196 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 "" #: ../Doc/library/asyncio-future.rst:231 msgid "" "The Future object was designed to mimic :class:`concurrent.futures.Future`. " "Key differences include:" msgstr "" #: ../Doc/library/asyncio-future.rst:234 msgid "" "unlike asyncio Futures, :class:`concurrent.futures.Future` instances cannot " "be awaited." msgstr "" #: ../Doc/library/asyncio-future.rst:237 msgid "" ":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` do not " "accept the *timeout* argument." msgstr "" #: ../Doc/library/asyncio-future.rst:240 msgid "" ":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise an :" "exc:`InvalidStateError` exception when the Future is not *done*." msgstr "" #: ../Doc/library/asyncio-future.rst:244 msgid "" "Callbacks registered with :meth:`asyncio.Future.add_done_callback` are not " "called immediately. They are scheduled with :meth:`loop.call_soon` instead." msgstr "" #: ../Doc/library/asyncio-future.rst:248 msgid "" "asyncio Future is not compatible with the :func:`concurrent.futures.wait` " "and :func:`concurrent.futures.as_completed` functions." msgstr ""