Error "dictionary changed size during iteration" in ops.py
Created by: skylian
When using functions in ops.py, I got the error "dictionary changed size during iteration". The problem lies in the following code snippet, which appears in every function in ops.py
.
kwargs = dict()
for name in locals():
val = locals()[name]
if val is not None:
kwargs[name] = val
Inside the for loop, a new variable val
is added into locals()
, causing the error.