Install & Compatibility
Where this runs
tested against v0.0.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.064s · 17.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.058s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
map
✓ from para import map
The primary function is map, used to apply a function to an iterable in parallel.
map_unordered
✓ from para import map_unordered
Returns results as they complete, useful for non-dependent tasks.
map_starmap
✓ from para import map_starmap
Like map but unpacks argument tuples.
Parallel mapping of a CPU-intensive function across 4 processes.
from para import map
def square(x):
return x * x
results = map(square, range(10), nprocesses=4)
print(list(results))
# [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Errors
Common errors & fixes
AttributeError: Can't pickle local object 'my_function.<locals>.<lambda>'
Lambda functions cannot be pickled by multiprocessing.
fixUse a named top-level function instead of lambda.
TypeError: map() got an unexpected keyword argument 'nprocesses'
The parameter is 'nprocesses' (note the uppercase 'P'), not 'nprocesses'.
fixUse correct keyword: map(func, data, nprocesses=4).
Upgrade
Version history
0.0.8latest on PyPI · released Jan 17, 2020
Audit
Dependencies
No dependency data recorded yet.