Skip to content

Commit c49021d

Browse files
committed
RF: delay imports of ipython until necessary through adapter functions
Partially addresses #176
1 parent af1d7c5 commit c49021d

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

tqdm/__init__.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from ._tqdm_gui import tqdm_gui
44
from ._tqdm_gui import tgrange
55
from ._tqdm_pandas import tqdm_pandas
6-
from ._tqdm_notebook import tqdm_notebook
7-
from ._tqdm_notebook import tnrange
86
from ._main import main
97
from ._main import TqdmKeyError
108
from ._main import TqdmTypeError
@@ -13,3 +11,21 @@
1311
__all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',
1412
'tqdm_notebook', 'tnrange', 'main', 'TqdmKeyError', 'TqdmTypeError',
1513
'__version__']
14+
15+
16+
def tqdm_notebook(*args, **kwargs):
17+
"""See tqdm._tqdm_notebook.tqdm_notebook for full documentation
18+
19+
This is just an adapter to delay imports
20+
"""
21+
from ._tqdm_notebook import tqdm_notebook as _tqdm_notebook
22+
return _tqdm_notebook(*args, **kwargs)
23+
24+
25+
def tnrange(*args, **kwargs):
26+
"""See tqdm._tqdm_notebook.tnrange for full documentation
27+
28+
This is just an adapter to delay imports
29+
"""
30+
from ._tqdm_notebook import tnrange as _tnrange
31+
return _tnrange(*args, **kwargs)

0 commit comments

Comments
 (0)