lisa.utils.unzip_into#

lisa.utils.unzip_into(n, iterator)[source]#

Unzip a given iterator into n variables.

Example:

orig_a = [1, 3]
orig_b = [2, 4]
a, b = unzip_into(2, zip(orig_a, orig_b))
assert list(a) == list(orig_a)
assert list(b) == list(orig_b)

Note

n is needed in order to handle properly the case where an empty iterator is passed.