pyinvoke / invoke

Pythonic task management & command execution.
http://pyinvoke.org
BSD 2-Clause "Simplified" License
4.31k stars 365 forks source link

autoprint generators correctly #992

Open anarcat opened 2 months ago

anarcat commented 2 months ago

if i have a task like this:

@task(autoprint=True)
def list_things(con):
    for thing in range(3):
        yield thing

invoke (well, fabric, in my case, but all the same right?) will do this:

$ fab list_things
<generator object _list_remote_repos at 0x7fee70de2d40>

I don't find that very pretty, and think it would be much more elegant to do:

$ fab list_things
1
2
3

no? :)