)]}'
{
  "commit": "f1f34ab0a01dbe0e6fd45239c2f0323d75aea6e2",
  "tree": "00aba3c84d43c6111ddbe2e5e41868671761522c",
  "parents": [
    "e51c2fd861deed7d0d518d4824a209a76f60180a"
  ],
  "author": {
    "name": "Quinn Cheong",
    "email": "58715320+quinncheong@users.noreply.github.com",
    "time": "Mon Oct 19 10:37:28 2026 +0800"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sun Oct 18 19:37:28 2026 -0700"
  },
  "message": "fix: accept __index__ objects for unsigned integers without conversion so enum \u003d\u003d numpy int works (#6193)\n\n* fix: accept __index__ objects for unsigned integers without conversion\n\nSince #5887 an enum with an unsigned underlying type compares unequal to\nnumpy integers, because the no-convert pass rejects __index__ objects for\nunsigned targets and the catch-all overload returns false. Closes #6192.\n\n* style: brace the early return now compiled on CPython\n\nThe no-convert early return was previously PyPy-only, so clang-tidy never\nsaw it; readability-braces-around-statements now flags it.\n\n* test: cover the unsigned integer caster directly\n\nAdd uint_passthrough(_noconvert) and run the existing int conversion\nmatrix against it, which also pins __index__ taking precedence over\n__int__ for unsigned targets. Gate the explicit PyNumber_Index call on\nPYBIND11_INDEX_CHECK so objects without __index__ no longer raise and\nclear an extra TypeError in convert mode, and select the PyPy/unsigned\ncondition with a constexpr bool instead of two #if\u0027d if-heads.\n\nAssisted-by: ClaudeCode:claude-fable-5-1\n\n* test: only expect the 3.9 __int__ DeprecationWarning for signed ints\n\nPyLong_AsUnsignedLong does not call __int__, so the unsigned caster\nfalls back to PyNumber_Long and does not warn.\n\nAssisted-by: ClaudeCode:claude-opus-5-5\n\n* refactor: drop the PyPy-only __index__ branch in the integer caster\n\nPyPy below the supported 7.3.17 is not a target, and supported PyPy calls __index__ in PyLong_AsLong[Long] like CPython, so only unsigned targets need the explicit PyNumber_Index call. Also drops the complex.h comment that pointed at the removed branch.\n\nAssisted-by: ClaudeCode:claude-opus-5-5\n\n* fix: preserve complex conversion precedence on PyPy\n\nKeep complex instances and __complex__ methods ahead of the legacy __index__ fallback. Retain support for older PyPy versions and update the workaround comment.\n\nAdd regression coverage for mixed protocols, complex subclasses, and failing __complex__ methods.\n\nAssisted-by: Codex\n\n* Make PyPy PyComplex_AsCComplex workaround specific to PyPy \u003c 8.0\n\n---------\n\nCo-authored-by: Henry Schreiner \u003chenryfs@princeton.edu\u003e\nCo-authored-by: Ralf W. Grosse-Kunstleve \u003crgrossekunst@nvidia.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d9e59721dde5d8552ea04bfc6bbd14e296497bcb",
      "old_mode": 33188,
      "old_path": "include/pybind11/cast.h",
      "new_id": "891f1c9d18239b9d03c387deb607f1824841ecb2",
      "new_mode": 33188,
      "new_path": "include/pybind11/cast.h"
    },
    {
      "type": "modify",
      "old_id": "9d0812f09f7327b02135027c1a6f0b9cce825eec",
      "old_mode": 33188,
      "old_path": "include/pybind11/complex.h",
      "new_id": "2d37a1227730f0bbd6d38b6760b8198dab9c9903",
      "new_mode": 33188,
      "new_path": "include/pybind11/complex.h"
    },
    {
      "type": "modify",
      "old_id": "40803fbf8ae4328577e08a842a0800578148f7f7",
      "old_mode": 33188,
      "old_path": "tests/test_builtin_casters.cpp",
      "new_id": "b7599615e3e2beaf8a26825e2797974a4999cc2a",
      "new_mode": 33188,
      "new_path": "tests/test_builtin_casters.cpp"
    },
    {
      "type": "modify",
      "old_id": "a08ac410b65edda601da4780327e44697fe39a0c",
      "old_mode": 33188,
      "old_path": "tests/test_builtin_casters.py",
      "new_id": "474a4a5eb20183b874f29f0dae7149a64aa9f272",
      "new_mode": 33188,
      "new_path": "tests/test_builtin_casters.py"
    },
    {
      "type": "modify",
      "old_id": "2a7fa0fda0741ab72b551c8b28fae5a305740cd1",
      "old_mode": 33188,
      "old_path": "tests/test_enum.cpp",
      "new_id": "186bc922cb96f929ba04b39a87a7f3506d960717",
      "new_mode": 33188,
      "new_path": "tests/test_enum.cpp"
    },
    {
      "type": "modify",
      "old_id": "81170c91ddd5915463284582c6d6cf5c20b127fb",
      "old_mode": 33188,
      "old_path": "tests/test_enum.py",
      "new_id": "451807365cfff9a20678aa32839b21939b5c3e0f",
      "new_mode": 33188,
      "new_path": "tests/test_enum.py"
    }
  ]
}
