Raymond Hettinger added the comment: I agree with Antoine that, "As the name suggests, __getstate__ should probably not mutate anything."
Unless a problematic non-mutating example can be found, I suggest this be closed. For the most part, our rule has been that pure python code doesn't have to (and possibly cannot) defend itself against mid-stream mutation, while C code only has to defend itself to the point of avoiding a segfault. IMO, "RuntimeError: dictionary changed size during iteration" is an informative error message in this case. ---------- nosy: +rhettinger status: pending -> open _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10701> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com