◐ Shell
clean mode source ↗

Message 108967 - Python tracker

That solution looks sound to me, in particular documenting the semantics of repeated init() calls!

As for the underlying problem, it seems to me that an alternative to copying the existing structures rather than rebuilding them would be to use OrderedDicts. Although I can't think why it might be a preferable alternative, other than being a bit clearer that order of insertion can affect behaviour.