jpayne@68: """ jpayne@68: Enables multiple commonly used features. jpayne@68: jpayne@68: Method resolution order: jpayne@68: jpayne@68: - `tqdm.autonotebook` without import warnings jpayne@68: - `tqdm.asyncio` jpayne@68: - `tqdm.std` base class jpayne@68: jpayne@68: Usage: jpayne@68: >>> from tqdm.auto import trange, tqdm jpayne@68: >>> for i in trange(10): jpayne@68: ... ... jpayne@68: """ jpayne@68: import warnings jpayne@68: jpayne@68: from .std import TqdmExperimentalWarning jpayne@68: jpayne@68: with warnings.catch_warnings(): jpayne@68: warnings.simplefilter("ignore", category=TqdmExperimentalWarning) jpayne@68: from .autonotebook import tqdm as notebook_tqdm jpayne@68: jpayne@68: from .asyncio import tqdm as asyncio_tqdm jpayne@68: from .std import tqdm as std_tqdm jpayne@68: jpayne@68: if notebook_tqdm != std_tqdm: jpayne@68: class tqdm(notebook_tqdm, asyncio_tqdm): # pylint: disable=inconsistent-mro jpayne@68: pass jpayne@68: else: jpayne@68: tqdm = asyncio_tqdm jpayne@68: jpayne@68: jpayne@68: def trange(*args, **kwargs): jpayne@68: """ jpayne@68: A shortcut for `tqdm.auto.tqdm(range(*args), **kwargs)`. jpayne@68: """ jpayne@68: return tqdm(range(*args), **kwargs) jpayne@68: jpayne@68: jpayne@68: __all__ = ["tqdm", "trange"]