)]}'
{
  "commit": "bc95983d916d3dfd425f398d71564f813f1a5345",
  "tree": "82e648743c48da28b0f2deb6e64df45f2008a3dc",
  "parents": [
    "f5d467a7b127345cf0b993eacccf92362d67520c"
  ],
  "author": {
    "name": "Ryan Heard",
    "email": "ryanwheard@gmail.com",
    "time": "Wed Oct 14 06:02:21 2026 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Oct 14 12:02:21 2026 +0200"
  },
  "message": "[mypyc] Fix decorated `__new__` in native classes (#22192)\n\nFixes mypyc/mypyc#1249.\n\nA decorated method has no entry in `ClassIR.method_decls`, but the\nfunction below the decorators is in `ClassIR.methods`. For `__new__` the\ncode generator used both, and the result didn\u0027t work for any caller:\n\n- The constructor and `tp_new` called the function below the decorators\ndirectly, so a native call skipped the decorators.\n- The decorators were applied to the built-in `__new__` function that\ncalls `tp_new`. Setting the result on the class makes Python replace\n`tp_new`, which fails the safety check of that built-in function. Every\ncall that isn\u0027t a native constructor call raised `TypeError:\nC.__new__(C) is not safe, use object.__new__()`.\n- If `__new__` takes other arguments than `__init__`, the generated C\ndidn\u0027t compile (`too many arguments to function \u0027CPyDef_C_____new__\u0027`).\n- In a class with a built-in base class, `__new__` in the type dict came\nfrom the method table, whose flags don\u0027t match the wrapper function of\n`__new__`. Instantiating the class crashed.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bfb9e7652a4f8c5fbe87cfc0ed206d8d2a0e4bf6",
      "old_mode": 33188,
      "old_path": "mypyc/analysis/attrdefined.py",
      "new_id": "394bed47846b54fa9c57fc03489b1a8ee51eb5b0",
      "new_mode": 33188,
      "new_path": "mypyc/analysis/attrdefined.py"
    },
    {
      "type": "modify",
      "old_id": "2e5d6018739573c6916cbf05cfa17bc961bdd062",
      "old_mode": 33188,
      "old_path": "mypyc/codegen/emitclass.py",
      "new_id": "428187691df6f2e4e8675735f60e10f356c60ffa",
      "new_mode": 33188,
      "new_path": "mypyc/codegen/emitclass.py"
    },
    {
      "type": "modify",
      "old_id": "2f679c03e3eedca60639dbe132ef4a8f9c8f5479",
      "old_mode": 33188,
      "old_path": "mypyc/ir/class_ir.py",
      "new_id": "ee682847a6b6ccd88c5db853d5dd207b25b4d496",
      "new_mode": 33188,
      "new_path": "mypyc/ir/class_ir.py"
    },
    {
      "type": "modify",
      "old_id": "ef30a9c6441d0763913637e04344079d080ef0d1",
      "old_mode": 33188,
      "old_path": "mypyc/irbuild/function.py",
      "new_id": "f24203417f9e200133b68b957447c59f8f01d57e",
      "new_mode": 33188,
      "new_path": "mypyc/irbuild/function.py"
    },
    {
      "type": "modify",
      "old_id": "0752df93b540ef86ac345189ee77ee26a79f9bcb",
      "old_mode": 33188,
      "old_path": "mypyc/irbuild/prepare.py",
      "new_id": "318f94a4bf5fed36e2bd3f81dd99f6353c094a8f",
      "new_mode": 33188,
      "new_path": "mypyc/irbuild/prepare.py"
    },
    {
      "type": "modify",
      "old_id": "6acfbd0f84c435b85736eb5a14092ab008ed4090",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/irbuild-classes.test",
      "new_id": "1d2343ca5917884a01c5a200c3b7918e157bcfa1",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/irbuild-classes.test"
    },
    {
      "type": "modify",
      "old_id": "160245c8996b8e3310042970b78a3e367da92895",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/run-classes.test",
      "new_id": "ebeb04cf1fa598fa53fba9121781d3c98274a30e",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/run-classes.test"
    },
    {
      "type": "modify",
      "old_id": "77c89d110f5e5681ea869bf26870439ab1f36611",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/run-multimodule.test",
      "new_id": "74fcf2e8d94b83d1cabad375a0cc64a9cc4a72ff",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/run-multimodule.test"
    }
  ]
}
