Format: text/x-python
⬇ Download File (950 B)
   1  """
   2  To use Jedi completion in Python interpreter, add the following in your shell
   3  setup (e.g., ``.bashrc``). This works only on Linux/Mac, because readline is
   4  not available on Windows. If you still want Jedi autocompletion in your REPL,
   5  just use IPython instead::
   6  
   7      export PYTHONSTARTUP="$(python -m jedi repl)"
   8  
   9  Then you will be able to use Jedi completer in your Python interpreter::
  10  
  11      $ python
  12      Python 3.9.2+ (default, Jul 20 2020, 22:15:08)
  13      [GCC 4.6.1] on linux2
  14      Type "help", "copyright", "credits" or "license" for more information.
  15      >>> import os
  16      >>> os.path.join('a', 'b').split().in<TAB>            # doctest: +SKIP
  17      ..dex   ..sert
  18  
  19  """
  20  import jedi.utils
  21  from jedi import __version__ as __jedi_version__
  22  
  23  print('REPL completion using Jedi %s' % __jedi_version__)
  24  jedi.utils.setup_readline(fuzzy=False)
  25  
  26  del jedi
  27  
  28  # Note: try not to do many things here, as it will contaminate global
  29  # namespace of the interpreter.
  30