06.11.13 07:41, Nick Coghlan написав(ла):
If the benchmark suite indicates there's no measurable speed penalty
then such a patch may be worth reconsidering.

I don't see any significant speed difference even in artificial presumably worst case (a lot of items assignment in tight loop).
If you have tests which demonstrate a difference, please show them.

I'd be astonished if that
was actually the case, though - the lowest impact approach I can think
of is to check for live iterators when setting a dict entry, and that
still has non-trivial size and speed implications.

Actually we should guard not against changing dict during iteration, but against iterating modifying dict (and only such modifications which change dict's keys). For this we need only keys modification counter in a dict and it's copy in an iterator (this doesn't increase memory requirements however). I suppose Java use same technique in HashMap.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to