{
  "id": "python/typeerror-unsupported-operand-type",
  "signature": "TypeError: unsupported operand type(s) for +: 'int' and 'str'",
  "signature_zh": "类型错误：+ 不支持的操作数类型：'int' 和 'str'",
  "regex": "TypeError:\\ unsupported\\ operand\\ type\\(s\\)\\ for\\ \\+:\\ 'int'\\ and\\ 'str'",
  "domain": "python",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "A test function tries to add an integer and a string, which is not allowed without explicit conversion.",
  "root_cause_type": "generic",
  "root_cause_zh": "测试函数尝试将整数和字符串相加，未经显式转换不允许。",
  "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 str() on both operands",
      "why_fails": "Converts both to strings, resulting in concatenation instead of addition.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using int() on string without validation",
      "why_fails": "If string is not numeric, int() raises ValueError.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Convert string to int before addition",
      "success_rate": 0.95,
      "how": "result = 5 + int('3')",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure type consistency in test data",
      "success_rate": 0.9,
      "how": "a = 5; b = 3; result = a + b",
      "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-07-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}