Skip to content

Progress bar should advance at end of loop #651

Closed
@jdno

Description

@jdno

I'm using the progress bar with a piece of code like this:

with click.progressbar(some_list) as bar:
    for element in bar:
        element.long_calculation

It seems that the progress bar updates every time it enters the loop, which for the last element means the bar shows everything has been completed, although the last computation just started. It would be great if it would show the progress in terms of results, not as an iterator.

I looked briefly at the implementation in _termui_impl.py, but the rendering seems to be closely linked to the pos attribute and I don't feel comfortable to mess with that. 😒

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions