Staging: this is not the live site, pydocs.org.
Networking and Interprocess Communication
Deprecated since 3.10. Deprecation warning is emitted if loop is not specified and there is no running event loop.
A coroutine wrapped in a Future.
Changed in 3.7, 3.8, 3.11, 3.12, 3.13
- 3.7: Added support for the contextvars module.
- 3.8: Added the name parameter.
- 3.11: Added the context parameter.
- 3.12: Added the eager_start parameter.
- 3.13: Changed to rescind pending cancellation requests upon reaching zero.
Members of Task
c
- cancel
- Request that this task cancel itself.
- cancelled
- Return True if the future was cancelled.
- cancelling
- Return the count of the task's cancellation requests.
d
- done
- Return True if the future is done.
e
- exception
- Return the exception that was set on this future.
g
- get_context
- Return the contextvars.Context object associated with the task.
- get_coro
- Return the coroutine object wrapped by the Task.
- get_stack
- Return the list of stack frames for this task's coroutine.
p
- print_stack
- Print the stack or traceback for this task's coroutine.
r
- result
- Return the result this future represents.
u
- uncancel
- Decrement the task's count of cancellation requests.