Files
Christian Legnitto 2180f535d8 Fix sub_table ordering for nested inlined comprehensions (PEP 709) (#7480)
When an inlined comprehension's first iterator expression contains
nested scopes (such as a lambda), those scopes' sub_tables appear at the
current position in the parent's sub_table list. The previous code
spliced the comprehension's own child sub_tables (e.g. inner inlined
comprehensions) into that same position before compiling the iterator,
which shifted the iterator's sub_tables to wrong indices.

Move the splice after the first iterator is compiled so its sub_tables
are consumed at their original positions.

Fixes nested list comprehensions like:
```python
    [[x for _, x in g] for _, g in itertools.groupby(..., lambda x: ...)]
```

Disclosure: I used AI to develop the patch though I was heavily
involved.
2026-03-22 17:23:03 +09:00
..
2025-12-12 22:46:39 +09:00
2020-09-13 06:58:57 +09:00
2020-09-13 06:58:57 +09:00
2020-09-13 06:58:57 +09:00
2020-09-13 06:58:57 +09:00
2020-09-13 06:58:57 +09:00
2020-09-13 06:58:57 +09:00
2025-11-15 23:09:31 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2026-01-17 19:21:10 +09:00
2026-01-17 19:21:11 +09:00
2023-03-05 22:34:55 +09:00
2025-06-22 00:00:07 +09:00
2025-07-07 19:02:37 +09:00
2026-01-17 19:21:11 +09:00
2020-09-13 06:58:57 +09:00
2023-03-05 22:34:55 +09:00
2026-01-17 19:21:11 +09:00
2026-01-29 16:48:02 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2020-09-13 06:58:57 +09:00
2026-01-17 19:21:11 +09:00
2026-01-17 19:21:11 +09:00
2020-09-13 06:58:57 +09:00
2025-12-12 22:46:39 +09:00
2020-09-13 06:58:57 +09:00
2025-05-12 14:20:01 +09:00
2025-05-12 14:20:01 +09:00
2025-12-12 22:46:39 +09:00
2026-02-08 13:58:30 +00:00
2022-10-17 13:45:15 +09:00
2023-05-23 16:43:52 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2020-09-13 06:58:57 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2026-01-17 19:21:11 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2025-12-12 22:46:39 +09:00
2023-05-19 14:05:36 -04:00
2025-02-13 14:11:01 +09:00
2026-01-17 19:21:11 +09:00
2023-02-13 21:28:19 +09:00
2022-05-04 02:54:59 +09:00
2025-08-26 21:48:46 +09:00
2026-03-08 22:53:26 +09:00
2020-09-13 06:58:57 +09:00