Skip to content
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

define 'iterable' = None in tg_tqdm() #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

metya
Copy link

@metya metya commented Apr 14, 2019

Define parameter 'iterable' is None by default in tg_tqdm().

It is makes possible operate with tg_tqdm like as tqdm original with 'with' statement.
For example:

with tg_tqdm(token=example_bot_token, chat_id=example_chat_id, total=100) as t:
    while some_statement is True:
        do_someting():
        t.update()

It is really can be useful with some unknown action that not iterable itself of don't have length of itself.

Otherwise, it was necessary to do it like:

with tg_tqdm(iterable = range(1), token=example_bot_token, chat_id=example_chat_id, total=100) as t:
    while some_statement is True:
        do_someting():
        t.update()

define parameter 'iterable' is None by default in tg_tqdm().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant