You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defer uuid, unicodedata, guarded_eval and latex_symbols in the completer
`IPython.core.completer` is imported at startup, but none of these is
needed until a completion is actually requested: `uuid` names a profiler
output file, `unicodedata` backs `\GREEK SMALL LETTER ...` completion,
`IPython.core.guarded_eval` evaluates expressions for attribute and dict
key completion, and `IPython.core.latex_symbols` backs `\alpha`
completion. Every use is inside a function body, so they move to their
use sites.
Note the module's own body is not the cost it can appear to be: a
`-X importtime` run over a stale `__pycache__` attributes byte-compilation
of the whole file to it (12 ms here); warm it is under 2 ms. Nor is
`find_spec("jedi")`, which is 0.05 ms.
In a clean interpreter `import IPython.terminal.ipapp` goes from 482 to
479 modules. `unicodedata` and `guarded_eval` remain, now reached via
`terminal/ptutils.py` and `terminal/shortcuts/filters.py`.
0 commit comments