Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
Closed as not planned
Description
Crash report
What happened?
This snippet causes a segfault on current main:
importtypeslst= []classX:def__repr__(self):lst.clear()return"x"lst+= [X(),1]ga=types.GenericAlias(int,lst)print(repr(ga))
This is because thega_repr_items_list() function does not properly handle the case where the list is mutated while we're iterating over it.
Similar to#143635 but a distinct code path.
CPython versions tested on:
CPython main branch, 3.14
Operating systems tested on:
macOS
Output from running 'python -VV' on the command line:
Python 3.15.0a4+ (heads/main:1857a40807d, Jan 13 2026, 19:01:52) [Clang 15.0.0 (clang-1500.3.9.4)]