{
  "id": "python/recursionerror-maximum-recursion-depth",
  "signature": "RecursionError: maximum recursion depth exceeded while calling a Python object",
  "signature_zh": "递归错误：调用 Python 对象时超过最大递归深度",
  "regex": "RecursionError:\\ maximum\\ recursion\\ depth\\ exceeded\\ while\\ calling\\ a\\ Python\\ object",
  "domain": "python",
  "category": "system_error",
  "subcategory": null,
  "root_cause": "A test function or fixture calls itself recursively without a base case, or a mock setup causes infinite recursion.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试函数或 fixture 在没有基本情况的情况下递归调用自身，或模拟设置导致无限递归。",
  "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": "Increasing recursion limit with sys.setrecursionlimit",
      "why_fails": "Postpones the problem; may cause stack overflow or crash.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignoring the error",
      "why_fails": "The test will always fail until recursion is fixed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add a base case to recursive function",
      "success_rate": 0.95,
      "how": "def recursive_func(n):\n    if n <= 0: return\n    recursive_func(n-1)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use iterative approach instead of recursion",
      "success_rate": 0.9,
      "how": "def iterative_func(n):\n    while n > 0:\n        n -= 1",
      "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-11-01",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}