zeehio / parmap

Easy to use map and starmap python equivalents
Apache License 2.0
144 stars 9 forks source link

lambda and nested functions #13

Open wjaskowski opened 6 years ago

wjaskowski commented 6 years ago

Do you see any possibilities to allow lambda or nested functions with parmap.map?

zeehio commented 6 years ago

Not really. Unfortunately lambda functions are not pickable, so they are not suitable for multiprocessing.

There are some workarounds, see for instance: https://stackoverflow.com/questions/4827432/how-to-let-pool-map-take-a-lambda-function

I'll close this because I can't fix it, but feel free to comment if you have doubts.

wjaskowski commented 6 years ago

What about using https://github.com/pya/pickablelambda under the hood?

zeehio commented 6 years ago

Looks good! I don't have much free time right now to implement this. Feel free to submit a pull request if you want, otherwise I will do the work eventually :+1: