Message303856
This is different case than mutating a dict while iterate it. In this case the failure is caused by GC, and it is always hard to handle such issues. In case of a dict you can just copy it before iterating. But what to do with RuntimeError from slicing a list if copying a list is vulnerable to the same issue?
The example of yet one solution you can see in dict_keys() in dictobject.c. I always wondered why this code is needed. |
|
| Date |
User |
Action |
Args |
| 2017-10-06 20:43:42 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, tim.peters, twouters, pitrou, vstinner, Oren Milman, geeknik |
| 2017-10-06 20:43:42 | serhiy.storchaka | set | messageid: <[email protected]> |
| 2017-10-06 20:43:42 | serhiy.storchaka | link | issue31165 messages |
| 2017-10-06 20:43:42 | serhiy.storchaka | create | |
|