I have built a module which is using a few different modules for various tasks. When I'm importing my module in IPython and listing the available functions for autocompletion, these external modules are included in that list. Is it possible to hide them in some way?
In Python, modules can define an __all__
variable, which is a list of the names that should be imported when someone does:
from module import *
IPython can use the same variable to limit completions, though it does not do this by default. To enable this at runtime, set:
get_ipython().Completer.limit_to__all__ = True
Or to set it permanently, add to your ipython_config.py
:
c.IPCompleter.limit_to__all__ = True
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With