diff --git a/benchmarks/benchmarks.py b/benchmarks/benchmarks.py index 5698600d..37f5df41 100644 --- a/benchmarks/benchmarks.py +++ b/benchmarks/benchmarks.py @@ -22,7 +22,7 @@ class Comparison: def run(self, cls): pbar = cls(self.iterable) t0 = self.time() - [0 for _ in pbar] + [0 for _ in pbar] # pylint: disable=pointless-statement t1 = self.time() return t1 - t0 diff --git a/examples/include_no_requirements.py b/examples/include_no_requirements.py index 3682d884..c51a85cb 100644 --- a/examples/include_no_requirements.py +++ b/examples/include_no_requirements.py @@ -7,3 +7,5 @@ except ImportError: if args: return args[0] return kwargs.get('iterable', None) + +__all__ = ['tqdm'] diff --git a/tests/tests_main.py b/tests/tests_main.py index 56453624..c02c896b 100644 --- a/tests/tests_main.py +++ b/tests/tests_main.py @@ -61,7 +61,7 @@ def test_main_import(): sys.argv = ['', '--desc', 'Test CLI import', '--ascii', 'True', '--unit_scale', 'True'] try: - import tqdm.__main__ # NOQA + import tqdm.__main__ # NOQA, pylint: disable=unused-variable finally: sys.stdin, sys.argv = _SYS diff --git a/tqdm/_utils.py b/tqdm/_utils.py index 5bf54bb8..2228691e 100644 --- a/tqdm/_utils.py +++ b/tqdm/_utils.py @@ -1,7 +1,7 @@ from warnings import warn from .std import TqdmDeprecationWarning -from .utils import ( # NOQA +from .utils import ( # NOQA, pylint: disable=unused-import CUR_OS, IS_NIX, IS_WIN, RE_ANSI, Comparable, FormatReplace, SimpleTextIOWrapper, _basestring, _environ_cols_wrapper, _is_ascii, _is_utf, _range, _screen_shape_linux, _screen_shape_tput, _screen_shape_windows, _screen_shape_wrapper, _supports_unicode, diff --git a/tqdm/notebook.py b/tqdm/notebook.py index a1f6f8e1..1e1431d8 100644 --- a/tqdm/notebook.py +++ b/tqdm/notebook.py @@ -248,9 +248,9 @@ class tqdm_notebook(std_tqdm): if not self.disable: self.display() - def __iter__(self, *args, **kwargs): + def __iter__(self): try: - for obj in super(tqdm_notebook, self).__iter__(*args, **kwargs): + for obj in super(tqdm_notebook, self).__iter__(): # return super(tqdm...) will not catch exception yield obj # NB: except ... [ as ...] breaks IPython async KeyboardInterrupt @@ -260,9 +260,9 @@ class tqdm_notebook(std_tqdm): # NB: don't `finally: close()` # since this could be a shared bar which the user will `reset()` - def update(self, *args, **kwargs): + def update(self, n=1): try: - return super(tqdm_notebook, self).update(*args, **kwargs) + return super(tqdm_notebook, self).update(n=n) # NB: except ... [ as ...] breaks IPython async KeyboardInterrupt except: # NOQA # cannot catch KeyboardInterrupt when using manual tqdm @@ -272,8 +272,8 @@ class tqdm_notebook(std_tqdm): # NB: don't `finally: close()` # since this could be a shared bar which the user will `reset()` - def close(self, *args, **kwargs): - super(tqdm_notebook, self).close(*args, **kwargs) + def close(self): + super(tqdm_notebook, self).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: