This does not seems to need to be a closure. Can we make it a normal function?
More serious question: Maybe we should stop passing around tuple of dictionnary and return an object holding all that data with a better API. What do you think ?
I resigned (and commented) on the wrong revision.
This code ideally should not be used outside this function. Hence a closure.
That is a bad reason to use a closure. Make the function private and move it at the module level.
(Mercurial used to be full of this strange closure and this was a pain)
Still a closure, please make it not a closure.