Message201751
The further from dict it goes, the more there is to remember. Considering the work around is so simple, I just don't think it's worth it:
for key in list(ordered_dict):
if some_condition:
del ordered_dict[key]
A simple list around the dict and we're good to go; and this trick works with dicts, defaultdicts, sets, lists (when you don't want the skipping behavior), etc. |
|
Date |
User |
Action |
Args |
2013-10-30 17:15:30 | ethan.furman | set | recipients:
+ ethan.furman, arigo, rhettinger, nikratio |
2013-10-30 17:15:30 | ethan.furman | set | messageid: <1383153330.0.0.530161715846.issue19414@psf.upfronthosting.co.za> |
2013-10-30 17:15:29 | ethan.furman | link | issue19414 messages |
2013-10-30 17:15:29 | ethan.furman | create | |
|