Message 308132 - Python tracker (original) (raw)

I have spent too much time in Python to be able to compare to other languages ;) but anywhere I saw RNG being used, there was a way to seed it or to provide a state. tempfile provides no such API

my usecase -- comparison of logs from two runs where I need to troubleshoot the point of divergence in execution . Logs in our case (datalad) contain temporary directory filenames, so they always "diff" and I need to sift through them or to come up with some obscure sed regex to unify them. I found in other projects of ours a really handy to be able to seed RNG globally so two runs result in identical execution path -- allows for easier reproducibility/comparison. But when it got to those temporary filenames -- apparently I could not make it happen and would need to resort to some heavy monkey patching.