Open hayd opened 10 years ago
Note: Can use multiprocessing with a manager (cleverly does all the locking for the shared object, I think this lend well to that):
d = multiprocessing.Manager().dict()
# here f updates d with filename -> diff
procs = [multiprocessing.Process(target=f, args=(file_name, d,)) for filename in filenames)] # or pass in d as default arg to f
for p in procs: p.start()
for p in procs: p.join() # wait until they terminate
# Can iterate/print the result from d
Obviously should turn off verbosity printing while it's doing this (can reset it back after maybe)
autopep8 has a jobs argument:
This would be great to have, if someone wanted to pick this up. Presumably you'd deal with each file separately (i.e. where it iterates over
filenames_diff
).This is less useful than autopep8's as by definition (?) we ought to be acting on a smaller set of fixes (and it should usually take less time than a full autopep8 pass).