)]}'
{
  "commit": "010bebbf9fd12bba1e3f40bdbddacd51a9c2bf20",
  "tree": "cbe5ea3c89ceab4d8583ec42dc98fa9d921639fb",
  "parents": [
    "801377967fd7bfa573c0b4c48e31b69d50c1da2f"
  ],
  "author": {
    "name": "Neil Schemenauer",
    "email": "nas-github@arctrix.com",
    "time": "Sat Oct 17 03:24:12 2026"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Sat Oct 17 03:24:12 2026"
  },
  "message": "gh-159136: Avoid stop-the-world when setting function name attributes (gh-159269)\n\nSetting __name__, __qualname__, __doc__ or __module__ on a function\nstopped the world in the free-threaded build since gh-154826 and\ngh-154851, making functools.wraps() orders of magnitude slower with\nmultiple threads.\n\nUse the per-object critical section and _PyObject_XSetRefDelayed()\ninstead, as gen_set_name() already does.  Use acquire loads in the\nreaders and hold strong references across error reporting, tracing, and\neval-frame recording that may execute Python or detach the thread.  The\n__code__, __defaults__, __kwdefaults__ and __closure__ setters still\nstop the world to clear func_version.\n\nDocument synchronization requirements for direct field access and the\nlifetime of borrowed function attributes.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "609b5e885b6b16215d154c3b1c1fed403a1fc1c9",
      "old_mode": 33188,
      "old_path": "Doc/c-api/function.rst",
      "new_id": "75a4adc810f90aaf7e25094c696378af40f5a1d9",
      "new_mode": 33188,
      "new_path": "Doc/c-api/function.rst"
    },
    {
      "type": "modify",
      "old_id": "54fd5a064aa2ac2e221ab914a750be147cc80da4",
      "old_mode": 33188,
      "old_path": "Doc/c-api/reflection.rst",
      "new_id": "37213dff216b5644980e708c5142accc48ee9ea0",
      "new_mode": 33188,
      "new_path": "Doc/c-api/reflection.rst"
    },
    {
      "type": "modify",
      "old_id": "9e1599a76485646166183c0af1582ae260fead06",
      "old_mode": 33188,
      "old_path": "Include/cpython/funcobject.h",
      "new_id": "bcdd9df561def3877a15a70f3050364c847583c2",
      "new_mode": 33188,
      "new_path": "Include/cpython/funcobject.h"
    },
    {
      "type": "modify",
      "old_id": "c1a278e5d4da9160bdb901af7d8b9fdded7d6ed9",
      "old_mode": 33188,
      "old_path": "Lib/test/test_capi/test_function.py",
      "new_id": "9a07e3106f3a22a940b0c5e577e0f5eadd84cc60",
      "new_mode": 33188,
      "new_path": "Lib/test/test_capi/test_function.py"
    },
    {
      "type": "modify",
      "old_id": "7a59638d27dc9d418d7c58ab1ce3c99748776db1",
      "old_mode": 33188,
      "old_path": "Lib/test/test_free_threading/test_functions.py",
      "new_id": "1874922d424db8bc552660931a6ed72317f12617",
      "new_mode": 33188,
      "new_path": "Lib/test/test_free_threading/test_functions.py"
    },
    {
      "type": "modify",
      "old_id": "9ebb76febd5d637634f91d98feb492ca85adc065",
      "old_mode": 33188,
      "old_path": "Lib/test/test_funcattrs.py",
      "new_id": "f091a6cb69c90f234f13d7c2274ac05ce4d38164",
      "new_mode": 33188,
      "new_path": "Lib/test/test_funcattrs.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "21fe270bbc1474a479a85d0645aa9d6454dcb4a3",
      "new_mode": 33188,
      "new_path": "Misc/NEWS.d/next/Core_and_Builtins/2026-10-12-20-00-00.gh-issue-159136.fnAttr.rst"
    },
    {
      "type": "modify",
      "old_id": "40767adbd3f14a73824579a4565ddffc709a5d49",
      "old_mode": 33188,
      "old_path": "Modules/_testcapi/function.c",
      "new_id": "28420ce19f112e96acca26aa75f9c54f56aeb7b6",
      "new_mode": 33188,
      "new_path": "Modules/_testcapi/function.c"
    },
    {
      "type": "modify",
      "old_id": "f629b8e528faca7d34e9cea8f8bd6686c82ef89c",
      "old_mode": 33188,
      "old_path": "Modules/_testinternalcapi.c",
      "new_id": "479297a996c250219f11a1de32eb62be52ca8dfa",
      "new_mode": 33188,
      "new_path": "Modules/_testinternalcapi.c"
    },
    {
      "type": "modify",
      "old_id": "4d3da234f87e494caf3290dc1d1787c0d00f852f",
      "old_mode": 33188,
      "old_path": "Objects/funcobject.c",
      "new_id": "f4adaf390e0cf934e8f93304ff55f6773c91f2b6",
      "new_mode": 33188,
      "new_path": "Objects/funcobject.c"
    },
    {
      "type": "modify",
      "old_id": "c313002c723e317e59235c0c88b37c980d14c7ba",
      "old_mode": 33188,
      "old_path": "Objects/genobject.c",
      "new_id": "05a331e88b88c92de866ca98cf6dc9c5989d6950",
      "new_mode": 33188,
      "new_path": "Objects/genobject.c"
    },
    {
      "type": "modify",
      "old_id": "43dc48f375301ccfe38e5aab6c2470c19a0f177e",
      "old_mode": 33188,
      "old_path": "Python/ceval.c",
      "new_id": "a6a21f0ac4c3bea49367868cabdbcb5208f8d062",
      "new_mode": 33188,
      "new_path": "Python/ceval.c"
    },
    {
      "type": "modify",
      "old_id": "0437ab85c5a668232c9709665aa848e1ee581914",
      "old_mode": 33188,
      "old_path": "Python/ceval.h",
      "new_id": "00db67265a4f3a12201827b4876b71e870bb9c43",
      "new_mode": 33188,
      "new_path": "Python/ceval.h"
    }
  ]
}
