{
  "id": "python/indexerror-list-index-out-of-range",
  "signature": "IndexError: list index out of range",
  "signature_zh": "索引错误：列表索引超出范围",
  "regex": "IndexError:\\ list\\ index\\ out\\ of\\ range",
  "domain": "python",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Accessing an index in a list that does not exist, e.g., list of length 3 with index 5.",
  "root_cause_type": "generic",
  "root_cause_zh": "访问列表中不存在的索引，例如长度为 3 的列表使用索引 5。",
  "versions": [
    {
      "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"
    },
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using try-except to ignore IndexError",
      "why_fails": "Ignores the problem; test may pass incorrectly.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using negative indexing blindly",
      "why_fails": "Negative indexing may access unintended elements if list length changes.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check list length before access",
      "success_rate": 0.95,
      "how": "if len(my_list) > index: value = my_list[index]",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use .get() equivalent for lists",
      "success_rate": 0.9,
      "how": "value = my_list[index] if index < len(my_list) else None",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-08-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}