How does python3.6 traverse and modify dictionaries

how does python3.6 traverse the modification dictionary, adding or deleting a dictionary in each nested dictionary, but it will report an error at run time? how can it not report an error?
A dictionary changed size during iteration exception will be thrown when traversing to modify the key-value pair of adding a dictionary.

Dec.27,2021

Let me give you a simple example:

>>> d={"a":10,"c":5}
>>> for k in d:
...     del d[k]
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: dictionary changed size during iteration

this problem can be solved by changing it to a key-value pair:

>>> for k,v in d.items():
...     del d[k]
...
>>> d
{}

therefore. You just need to modify it a little bit during the loop.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b86f-2c2a6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b86f-2c2a6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?