tqdm
can be used with zip
if a total
keyword argument is provided in the tqdm
call.
The following example demonstrates iteration over corresponding elements in two lists with a working __tqdm__
progress bar for the case where a total
keyword argument is used:
The issue is that tqdm
needs to know the length of the iterable ahead of time. Because zip
is meant to handle iterables with different lengths, it does not have as an attribute a single length of its arguments.
So, __tqdm__
still works nicely with zip
, you just need to provide a little manual control with the total
keyword argument.