{
  "id": "python/asyncio-gather-return-exceptions",
  "signature": "TypeError: An asyncio.Future, a coroutine or an awaitable is required",
  "signature_zh": "类型错误：需要asyncio.Future、协程或可等待对象",
  "regex": "TypeError:\\ An\\ asyncio\\.Future,\\ a\\ coroutine\\ or\\ an\\ awaitable\\ is\\ required",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Passing non-awaitable objects (e.g., a list of results) to asyncio.gather() or asyncio.wait()",
  "root_cause_type": "generic",
  "root_cause_zh": "向asyncio.gather()或asyncio.wait()传递不可等待的对象（如结果列表）。",
  "versions": [
    {
      "version": "3.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.9",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "ensure_future() expects coroutines or futures, not plain values.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "create_task() also requires coroutines, not arbitrary objects.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 1.0,
      "how": "await asyncio.gather(coro1(), coro2())",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.95,
      "how": "tasks = [asyncio.create_task(coro()) for coro in coros]; await asyncio.gather(*tasks)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}