Steven D'Aprano <ste...@remove.this.cybersource.com.au> writes: > (4) the caller is responsible for making sure he never shares data while > looping over it. > > I don't think I've missed any possibilities. You have to pick one of > those four.
I wonder if the compiler can check that a given function doesn't change any data. Then: @pure def f(x): return x*sqrt(x) + 3 # does not mutate any data @pure def g(x): ... # likewise s = parallel_dot_product(parallel_map(f, vec), parallel_map(g,vec)) -- http://mail.python.org/mailman/listinfo/python-list