set and dict iteration

Paul Rubin at nospam.invalid
Fri Aug 17 04:30:42 CEST 2012

Steven D'Aprano <steve+comp.lang.python at> writes:
> Luckily, Python is open source. If anyone thinks that sets and dicts 
> should include more code protecting against mutation-during-iteration, 
> they are more than welcome to come up with a patch. Don't forget unit and 
> regression tests, and also a set of timing results which show that the 
> slow-down isn't excessive.

It could be a debugging option, in which case even a fairly significant
slowdown is acceptable.

More information about the Python-list mailing list