From e2bd4eb303b357641716d19941b82f04c0d68059 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Mon, 13 May 2019 17:11:22 +0100 Subject: [PATCH] better reset() docs --- .readme.rst | 10 +++++++++- README.rst | 10 +++++++++- tqdm/_tqdm.py | 10 +++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.readme.rst b/.readme.rst index 74d8aefd..1ccc3459 100644 --- a/.readme.rst +++ b/.readme.rst @@ -341,7 +341,15 @@ Returns """Restart tqdm timer from last print time.""" def reset(self, total=None): - """Resets a bar to n=0 for repeated use.""" + """ + Resets to 0 iterations for repeated use. + + Consider combining with ``leave=True``. + + Parameters + ---------- + total : int, optional. Total to use for the new bar. + """ def set_description(self, desc=None, refresh=True): """ diff --git a/README.rst b/README.rst index 320bed54..2e93d560 100644 --- a/README.rst +++ b/README.rst @@ -450,7 +450,15 @@ Returns """Restart tqdm timer from last print time.""" def reset(self, total=None): - """Resets a bar to n=0 for repeated use.""" + """ + Resets to 0 iterations for repeated use. + + Consider combining with ``leave=True``. + + Parameters + ---------- + total : int, optional. Total to use for the new bar. + """ def set_description(self, desc=None, refresh=True): """ diff --git a/tqdm/_tqdm.py b/tqdm/_tqdm.py index 9df7509c..318249b8 100755 --- a/tqdm/_tqdm.py +++ b/tqdm/_tqdm.py @@ -1208,7 +1208,15 @@ class tqdm(Comparable): self.last_print_t = cur_t def reset(self, total=None): - """Resets a bar to n=0 for repeated use.""" + """ + Resets to 0 iterations for repeated use. + + Consider combining with `leave=True`. + + Parameters + ---------- + total : int, optional. Total to use for the new bar. + """ self.last_print_n = self.n = 0 self.last_print_t = self.start_t = self._time() if total is not None: