{
  "id": "python/fastapi-typeerror-argument-of-type-is-not-iterable",
  "signature": "TypeError: argument of type 'NoneType' is not iterable",
  "signature_zh": "类型错误：'NoneType'类型的参数不可迭代",
  "regex": "TypeError:\\ argument\\ of\\ type\\ 'NoneType'\\ is\\ not\\ iterable",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Trying to iterate over a variable that is None, often from a query parameter or dependency that returns None.",
  "root_cause_type": "generic",
  "root_cause_zh": "尝试迭代一个为None的变量，通常来自返回None的查询参数或依赖项。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Assuming all parameters are always provided",
      "why_fails": "Optional parameters can be None if not provided.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using for loop without checking None",
      "why_fails": "None is not iterable.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check for None before iterating",
      "success_rate": 0.95,
      "how": "if items is not None:\n    for item in items: pass",
      "condition": "",
      "sources": []
    },
    {
      "action": "Provide default empty list",
      "success_rate": 0.9,
      "how": "items = request.query_params.get('items', [])",
      "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.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-06-18",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}