I'm trying to solve two problems consecutively in the same program. Each problem defines its own field and variables. Specifically, I do this for testing (same problem creation and operation code run consecutively with different parameters), just for the context.
It fails when the second problem defines its field:
ValueError: order 0 already used!
which means that somewhere, there's a global mapping of numbers to variables which I need to clean.
I don't know how to do it, and if there are other such global states that need to be cleaned. So my question is whether there's some "nuke everything" function, or a checklist of things to clean, or some other way to do it?
My current workaround is to stick each run under a different process using the multiprocessing module. This works but I hope there's a less cumbersome way.
Thanks, Yosef Meller.