[Fixed] Possible bug with client Python environment and `OrderedDict.setdefault`

Minimal example app here.

In short, in the client environment, creating an OrderedDict, setting an element via setdefault and then trying to print the OrderedDict gives RuntimeError: odict changed size during iteration. The same doesn’t happen if the element is set via standard assignment.

This would be a fairly abstract problem if limited to printing but it also crops up when I’m trying to access elements of a double nested OrderedDict constructed this way.

Thanks @c.cave-ayland for reporting that is indeed a bug in our python to javascript compiler. (Moved to bug reports)

If it helps, since python 3.6 dictionaries respect insertion order. This should be implemented on both the server and the client. So you might not even need an OrderedDict

@c.cave-ayland this should now be fixed for OrderedDict.