mirror of https://github.com/tqdm/tqdm.git
better reset() docs
This commit is contained in:
parent
13f8af1aad
commit
e2bd4eb303
10
.readme.rst
10
.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):
|
||||
"""
|
||||
|
|
10
README.rst
10
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):
|
||||
"""
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue