better reset() docs

This commit is contained in:
Casper da Costa-Luis 2019-05-13 17:11:22 +01:00
parent 13f8af1aad
commit e2bd4eb303
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
3 changed files with 27 additions and 3 deletions

View File

@ -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):
"""

View File

@ -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):
"""

View File

@ -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: