)]}'
{
  "commit": "f891299e6adb7f90155d979907d3787836dd47d9",
  "tree": "49272c4c38d10051727dd4d7cf247b82bc039fdc",
  "parents": [
    "a2592ad9d6510a4d48b4706852ef812bb01401c4"
  ],
  "author": {
    "name": "ctmd1234567",
    "email": "wang195072@gmail.com",
    "time": "Mon May 25 12:04:39 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sun May 24 21:04:39 2026 -0700"
  },
  "message": "Fix custom __str__ for enum_ (#6078)\n\n* fix: prioritize custom enum __str__\n\n* test: strengthen custom enum __str__ regression\n\n* refactor: move enum __str__ handling into enum_\n\nKeep class_::def() generic and let enum_ own the enum-specific\nbehavior for custom __str__ overloads. This avoids using the private\n__entries attribute as a runtime sentinel for py::enum_ while preserving\nthe prepend behavior that lets user-defined enum __str__ methods take\nprecedence over the generated default.\n\nOne caveat is that this applies to normal py::enum_ API usage. Code that\nintentionally upcasts an enum_ binding to class_\u0026 and then calls\nclass_::def(\"__str__\", ...) will bypass this enum_ override and keep the\ngeneric class_ behavior.\n\n* fix: avoid enum def ambiguity on MinGW\n\nRemove the inherited class_::def overload set from enum_ and add an explicit forwarding overload for non-string def() calls. GCC 15 on MinGW otherwise sees the duplicate dependent-base def(const char *, ...) template as ambiguous with enum_::def(const char *, ...), breaking the C++11 build.\n\n---------\n\nCo-authored-by: ctmd1234567 \u003cctmd1234567@users.noreply.github.com\u003e\nCo-authored-by: Ralf W. Grosse-Kunstleve \u003crgrossekunst@nvidia.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9cc45bdbdc1df21404c64d8d39a0e5f578243f07",
      "old_mode": 33188,
      "old_path": "include/pybind11/pybind11.h",
      "new_id": "ccd7baee02b46275127d29bf46846b70e0e8503f",
      "new_mode": 33188,
      "new_path": "include/pybind11/pybind11.h"
    },
    {
      "type": "modify",
      "old_id": "4ec0af7245b43067dabd97365c188af99fa63955",
      "old_mode": 33188,
      "old_path": "tests/test_enum.cpp",
      "new_id": "2a7fa0fda0741ab72b551c8b28fae5a305740cd1",
      "new_mode": 33188,
      "new_path": "tests/test_enum.cpp"
    },
    {
      "type": "modify",
      "old_id": "52083caa03e4652a24f704f414a7ab9cddc92756",
      "old_mode": 33188,
      "old_path": "tests/test_enum.py",
      "new_id": "969c30b1b05d984b91c85f4dc6560ec6b674c412",
      "new_mode": 33188,
      "new_path": "tests/test_enum.py"
    }
  ]
}
