This documentation covers a development version of IPython. The development version may differ significantly from the latest stable release.
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).
This document describes in-flight development work.
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
Released …. …., 2019
Need to be updated:
- Antigravity feature
- Empty History Ranges
YouTubeVideoautoplay and the ability to add extra attributes to
- History Range Glob feature
- Incompatible change switch to perl
- IPython shell for ipdb interact
- Pastebin magic expiry days option
- Remove Deprecated Stuff
- Don’t start a multiline cell with sunken parenthesis
- Traceback improvements
- Automatic Vi prompt stripping
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
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 = [[]] return x[i] def bar(): return foo(0) + foo( 1 ) + foo(2)
bar() would raise an
IndexError on the return line of
IPython 8.0 is capable of telling you, where the index error occurs:
return x[i] ^
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
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.
This feature allows users to accept autosuggestions with ctrl e, ctrl f, or right arrow as described below.
Press p to see the autosuggestion
Press ctrl f, or ctrl e, or right arrow to accept the suggestion
You can also complete word by word:
def say_hello(): print("hello")
Press d to see the autosuggestion
Press alt f to accept the first word of the suggestion
Importantly, this feature does not interfere with tab completion:
def say_hello(): print("hello"), press d
Press Tab to start tab completion
3A. Press Tab again to select the first option
3B. Press alt f to accept to accept the first word of the suggestion
3C. Press ctrl f or ctrl e to accept the entire suggestion
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:
The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
To use these shortcuts in vi insert mode, you will have to create custom keybindings in your config.py.
Show pinfo information in ipdb using “?” and “??”¶
In IPDB, it is now possible to show the information about an object using “?” and “??”, in much the same way it can be done when using the IPython prompt:
ipdb> partial? Init signature: partial(self, /, *args, **kwargs) Docstring: partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords. File: ~/.pyenv/versions/3.8.6/lib/python3.8/functools.py Type: type Subclasses:
Previously, “pinfo” or “pinfo2” command had to be used for this purpose.
Autoreload 3 feature¶
Example: When an IPython session is ran with the ‘autoreload’ extension loaded, you will now have the option ‘3’ to select which means the following:
replicate all functionality from option 2
autoload all new funcs/classes/enums/globals from the module when they’re added
autoload all newly imported funcs/classes/enums/globals from external modules
%autoreload 3 in an IPython session after running
- For more information please see unit test -
extensions/tests/test_autoreload.py : ‘test_autoload_newly_added_objects’
As a reminder, IPython master has diverged from the 7.x branch, thus master may have more feature and API changes.