The documentation for Progress is incomplete, and does not mention the start() function anywhere. This is very confusing, as trying to use the class without calling start() (or using a context manager) produces no output. For example, the following does not work:
from time import sleep
from rich.progress import Progress
progress = Progress()
task = progress.add_task(description='test Progress', total=100)
for n in range(100):
sleep(0.1)
progress.advance(task, 1)
progress.remove_task(task)
Adding progress.start() after instantiating works, as well as the following:
from time import sleep
from rich.progress import Progress
with Progress() as progress:
task = progress.add_task(description='test Progress', total=100)
for n in range(100):
sleep(0.1)
progress.advance(task, 1)
progress.remove_task(task)
It appears that start() is called in the __enter__ function, but nowhere is it mentioned that this should be called manually if not using a context manager. This should be clarified, or if the intended behavior is that a context manager is the ONLY acceptable method of using Progress(), then this should be documented as well, perhaps producing a warning if possible. It's worth noting that the documentation does say "The Progress class is designed to be used as a context manager which will start and stop the progress display automatically", however it doesn't indicate that failing to do so will cause no output.
It's worth noting that this same issue was encountered in #2758, and the developer there also indicated that the documentation was not clear.
Describe the bug
The documentation for
Progress
is incomplete, and does not mention thestart()
function anywhere. This is very confusing, as trying to use the class without callingstart()
(or using a context manager) produces no output. For example, the following does not work:Adding
progress.start()
after instantiating works, as well as the following:It appears that
start()
is called in the__enter__
function, but nowhere is it mentioned that this should be called manually if not using a context manager. This should be clarified, or if the intended behavior is that a context manager is the ONLY acceptable method of usingProgress()
, then this should be documented as well, perhaps producing a warning if possible. It's worth noting that the documentation does say "The Progress class is designed to be used as a context manager which will start and stop the progress display automatically", however it doesn't indicate that failing to do so will cause no output.It's worth noting that this same issue was encountered in #2758, and the developer there also indicated that the documentation was not clear.
Platform
Click to expand
This occurs on *all platforms*, but my current environment is shown below. ``` ╭─────────────────────────