cutcutcodec.core.opti.parallel.buffer.map

cutcutcodec.core.opti.parallel.buffer.map(func: callable, args: Iterable, maxsize: int | None = None)[source]

Like cutcutcodec.core.opti.parallel.starmap() with one argument.

Examples

>>> import time
>>> from cutcutcodec.core.opti.parallel.buffer import map
>>> def foo(t):
...     time.sleep(t)
...     return t
...
>>> list(map(foo, [1.0, 0.5, 0.0]))  # keep order
[1.0, 0.5, 0.0]
>>>