On this page
asyncio.isfuture
Prev: asyncio.iscoroutinefunction | Up: asyncio | Next: asyncio.new_event_loop
Rel: asyncio.AbstractEventLoop, asyncio.AbstractServer, asyncio.all_tasks, asyncio.as_completed
Ref: docs.python.org — asyncio.isfuture
Tags: #public #python3 #stdlib #asyncio
Import
import asyncio
from asyncio import isfuture
Signature & Overview
asyncio.isfuture(obj)
Check for a Future.
Usage
import asyncio
async def main():
fut = asyncio.get_running_loop().create_future()
assert asyncio.isfuture(fut) is True
assert asyncio.isfuture(123) is False
asyncio.run(main())
Gotchas
- True for
asyncio.Futureandasyncio.Task(and duck-typed_asyncio_future_blockingobjects).
REPL Inspect
from asyncio import isfuture
help(isfuture)
Linked from
Related notes
- tuts/python3/stdlib_module/asyncio/iscoroutinefunction Linked here; links to this page; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/new_event_loop Linked here; links to this page; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/asyncio/AbstractEventLoop Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/AbstractServer Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/all_tasks Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/as_completed Linked here; shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/Barrier shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/BaseEventLoop shared tags: #asyncio, #stdlib
- tuts/python3/stdlib_module/asyncio/BaseProtocol shared tags: #asyncio, #stdlib