-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behavior when combining initial
and range
as iterator.
#1561
Comments
Hi @twall, I have try to reproduce the issue here. The output is following
I am not sure if the last line is missed in your post. from tqdm import tqdm
for level in tqdm(list(range(1, 16)), initial=10, total=10+15):
print(f"Level={level}") |
I am expecting the iterations to start at 10 and finish at 15, for a total of 5 iterations, with the progress bar showing 15/15 when complete. |
almost works, except the final status is 16/16 instead of 15/15. Using |
Change it to |
Yes, that works. I was mistakenly interpreting |
read the known issues
environment, where applicable:
4.66.2 3.10.9 (main, Jan 11 2023, 09:18:20) [Clang 14.0.6 ] darwin
Output:
In this case, the
initial
argument is not completely ignored, since the status seems to stop at10
. I would expect either an exception or warning about the argument being ignored, or in the case of an indexable iterable actually use it to start at the correct index.My workaround is to ignore the first
initial
iterations, but it was unexpected to have the full set of iterations produced bytqdm
wheninitial
was specified.The text was updated successfully, but these errors were encountered: