##// END OF EJS Templates
some updates on 8.0
some updates on 8.0

File last commit:

r26308:23f31bb9
r26308:23f31bb9
Show More
development.rst
145 lines | 4.7 KiB | text/x-rst | RstLexer

Development version

This document describes in-flight development work.

Warning

Please do not edit this file by hand (doing so will likely cause merge conflicts for other Pull Requests). Instead, create a new file in the docs/source/whatsnew/pr folder

Released .... ...., 2019

Need to be updated:

IPython 8.0 is bringing a number of new features and improvements to both the user of the terminal and of the kernel via Jupyter. The removal of compatibility with older version of Python is also the opportunity to do a couple of performance improvement in particular with respect to startup time.

The main change in IPython 8.0 is the integration of the stack_data package; which provide smarter information in traceback; in particular it will highlight the AST node where an error occurs which can help to quickly narrow down errors.

For example in the following snippet:

def foo(i):
    x = [[[0]]]
    return x[0][i][0]


def bar():
    return foo(0) + foo(
        1
    ) + foo(2)

Calling bar() would raise an IndexError on the return line of foo, IPython 8.0 is capable of telling you, where the index error occurs:

return x[0][i][0]
            ^

To prepare for Python 3.10 we have also started working on removing reliance and any dependency that is not Python 3.10 compatible; that include migrating our test suite to Pytest, and starting to remove nose.

We are also removing support for Python 3.6 allowing internal code to use more efficient pathlib, and make better use of type annotations.

The completer has also seen significant updates and make use of newer Jedi API offering faster and more reliable tab completion.

For the terminal users this also enable the auto-suggestion feature, described below, which show "ghost text" ahead of your cursor you can accept without having to press the tab key or ask the completer to suggest completions.

Autosuggestion is a very useful feature available in fish, zsh, and prompt-toolkit.

Ptpython allows users to enable this feature in ptpython/config.py.

This feature allows users to accept autosuggestions with ctrl e, ctrl f, or right arrow as described below.

  1. Start ipython
../_images/auto_suggest_prompt_no_text.png
  1. Run print("hello")
../_images/auto_suggest_print_hello_suggest.png
  1. Press p to see the autosuggestion
../_images/auto_suggest_print_hello_suggest.png
  1. Press ctrl f, or ctrl e, or right arrow to accept the suggestion
../_images/auto_suggest_print_hello.png

You can also complete word by word:

  1. Run def say_hello(): print("hello")
../_images/auto_suggest_second_prompt.png
  1. Press d to see the autosuggestion
../_images/audo_suggest_d_phantom.png
  1. Press alt f to accept the first word of the suggestion
../_images/auto_suggest_def_phantom.png

Importantly, this feature does not interfere with tab completion:

  1. After running def say_hello(): print("hello"), press d
../_images/audo_suggest_d_phantom.png
  1. Press Tab to start tab completion
../_images/auto_suggest_d_completions.png

3A. Press Tab again to select the first option

../_images/auto_suggest_def_completions.png

3B. Press alt f to accept to accept the first word of the suggestion

../_images/auto_suggest_def_phantom.png

3C. Press ctrl f or ctrl e to accept the entire suggestion

../_images/auto_suggest_match_parens.png

To install a version of ipython with autosuggestions enabled, run:

pip install git+https://github.com/mskar/ipython@auto_suggest

Currently, autosuggestions are only shown in the emacs or vi insert editing modes:

As a reminder, IPython master has diverged from the 7.x branch, thus master may have more feature and API changes.

Backwards incompatible changes