On this page
  1. asyncio.isfuture
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from asyncio import isfuture
help(isfuture)

Linked from

Related notes