Make list.sort more safe
Use the CPython technique of swapping out the list contents for the duration of the sort, since the compare functions can look at the list. This wasn't even being triggered by something that explicitly looked at the list: the issue was that the comparison function invoked a gc collection and the gc saw the half-mutated list.
Showing
Please register or sign in to comment