Skip to content

Enabling iteration over non-lists

Compare
Choose a tag to compare
@swansonk14 swansonk14 released this 09 Apr 04:53
eb122f7

Previously, p_tqdm specifically checked whether the provided iterables were lists. This meant that iteration over objects like numpy arrays and generators like range were performed incorrectly. This has now been fixed.

In the process of fixing the above, the treatment of non-lists has changed. Previously, non-lists were treated as singleton objects that were repeated as many times as the longest list. Now, singleton items (and the num_iters kwarg) should no longer be passed to p_tqdm maps since p_tqdm now expects all inputs to be iterators (and iterates until it reaches the end of the shortest one). To provide a singleton object along with the iterators, please use Python's partial from the functools library. An example is in the README.