diff options
Diffstat (limited to 'tqdm/notebook.py')
-rw-r--r-- | tqdm/notebook.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tqdm/notebook.py b/tqdm/notebook.py index 6ee43a6..77b91bd 100644 --- a/tqdm/notebook.py +++ b/tqdm/notebook.py @@ -80,7 +80,7 @@ class TqdmHBox(HBox): def __repr__(self, pretty=False): pbar = getattr(self, 'pbar', None) if pbar is None: - return super(TqdmHBox, self).__repr__() + return super().__repr__() return pbar.format_meter(**self._json_(pretty)) def _repr_pretty_(self, pp, *_, **__): @@ -220,7 +220,7 @@ class tqdm_notebook(std_tqdm): kwargs['disable'] = bool(kwargs.get('disable', False)) colour = kwargs.pop('colour', None) display_here = kwargs.pop('display', True) - super(tqdm_notebook, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) if self.disable or not kwargs['gui']: self.disp = lambda *_, **__: None return @@ -246,7 +246,7 @@ class tqdm_notebook(std_tqdm): def __iter__(self): try: - it = super(tqdm_notebook, self).__iter__() + it = super().__iter__() for obj in it: # return super(tqdm...) will not catch exception yield obj @@ -259,7 +259,7 @@ class tqdm_notebook(std_tqdm): def update(self, n=1): try: - return super(tqdm_notebook, self).update(n=n) + return super().update(n=n) # NB: except ... [ as ...] breaks IPython async KeyboardInterrupt except: # NOQA # cannot catch KeyboardInterrupt when using manual tqdm @@ -272,7 +272,7 @@ class tqdm_notebook(std_tqdm): def close(self): if self.disable: return - super(tqdm_notebook, self).close() + super().close() # Try to detect if there was an error or KeyboardInterrupt # in manual mode: if n < total, things probably got wrong if self.total and self.n < self.total: @@ -297,14 +297,14 @@ class tqdm_notebook(std_tqdm): total : int or float, optional. Total to use for the new bar. """ if self.disable: - return super(tqdm_notebook, self).reset(total=total) + return super().reset(total=total) _, pbar, _ = self.container.children pbar.bar_style = '' if total is not None: pbar.max = total if not self.total and self.ncols is None: # no longer unknown total pbar.layout.width = None # reset width - return super(tqdm_notebook, self).reset(total=total) + return super().reset(total=total) def tnrange(*args, **kwargs): |