)]}'
{
  "commit": "ce916dc50644bb1de940f5fb580bd9907cceb959",
  "tree": "1599c34b04c6bc715673b6681fcfb95648da7380",
  "parents": [
    "580499177ca91477b53b4a40afcec7d3370265b0"
  ],
  "author": {
    "name": "Bartosz Sławecki",
    "email": "bartosz@ilikepython.com",
    "time": "Tue Jun 09 22:22:13 2026"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Jun 09 22:22:13 2026"
  },
  "message": "gh-150700: Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends (#150735)\n\n* Fix class-scope inline comprehensions when nested scopes reference `__class__` and friends\n\nIn `inline_comprehension()`, when `__class__` / `__classdict__` /\n`__conditional_annotations__` appears as `FREE` in a comprehension\u0027s\nsymbol table because a nested scope captured it (e.g. nested lambdas),\nthis name is still discarded from `comp_free` unconditionally.\n\nThis prevents `drop_class_free()` from seeing it, so the appropriate\n`ste_needs_(...)` flag is never set on the enclosing class.\nThat leads to `codegen_make_closure()` throwing `SystemError` when it\ncouldn\u0027t find `__class__` / `__classdict__` /\n`__conditional_annotations__` in the class\u0027s cellvars.\n\nFrom now on we just discard from `comp_free` when no child scope\n(e.g. a lambda) still needs the name as `FREE`. When a child scope does\nneed it, keep it in `comp_free` so `drop_class_free()` can set the\nappropriate flag and the class creates the implicit cell.\n\n* Fix tests\n\n* Fix typo\n\n* Fix formatting\n\n* Add test checking validity of `__class__` returned\n\n* Prefer \u0027used\u0027 to \u0027deferred\u0027",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cee528722b85aa00e958fa8f7b34add6f7e9f04c",
      "old_mode": 33188,
      "old_path": "Lib/test/test_listcomps.py",
      "new_id": "cf3796d9480801598103051b27db63c726454de0",
      "new_mode": 33188,
      "new_path": "Lib/test/test_listcomps.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e7734034ff5c814ec5308386b83dfb643509a245",
      "new_mode": 33188,
      "new_path": "Misc/NEWS.d/next/Core_and_Builtins/2026-06-01-19-00-00.gh-issue-150700.W8CzVR.rst"
    },
    {
      "type": "modify",
      "old_id": "070e374101b5cd5632cf28fe089ffd7d2388d319",
      "old_mode": 33188,
      "old_path": "Python/symtable.c",
      "new_id": "00ac510fe76b97204fd00afc3344b41ab2dc2042",
      "new_mode": 33188,
      "new_path": "Python/symtable.c"
    }
  ]
}
