Ammar Askar <am...@ammaraskar.com> added the comment:

Think about what it means to iterate over a hashmap. Let's say your pop() 
causes the dictionary to become smaller than the resizing threshold and now the 
indexes need to be rebuilt, how would this be handled gently by the iterator?

This situation is not just something unique to python dictionaries, google 
around for "delete while iterating" and you'll find that most languages 
prohibit you from mutating containers while iterating over them.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35023>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to