IPython 8 Improves Code Reformatting
Written by Kay Ewbank   
Tuesday, 18 January 2022

IPython has been updated with improvements including code reformatting, ghost suggestions, and better tracebacks which highlight the error node. IPython 8 comes three years after the release of version 7.0

IPython is a Python REPL that offers tab completion, better tracebacks, multiline editing, and several useful features on top of pure Python Scripts. It is also the library that powers the Jupyter Kernel via the IPykernel.

Until 2015 IPython used to refer to the open source shell for interactive and parallel computing that was renamed as Jupyter. From that point onwards, IPython is used to refer to the Python kernel for Jupyter and the interactive Python shell.

This release removes compatibility with older version of Python, providing an opportunity to incorporate performance improvements, in particular with respect to startup time.

More importantly, the code base has been substantially updated, ensuring that IPython is no longer reliant on Nose, which has been unmaintained for many years.IPython now uses pytest, and the reworkings have significantly increased IPython coverage. Many known bugs have also been removed.

The build process has also been heavily reworked. It now uses pyproject.tomlto have a declarative build. The developers say they still require setuptools and have setup.py files right now, but they are working towards removing/simplifying them soon.

In terms of actual improvements, the first change is to code reformat. If black is installed in the same environment as IPython, terminal IPython will now by default reformat the code in the CLI when possible.

Ghost autosuggestons have also been added. The developers point out that autosuggestion is a very useful feature available in fish, zsh, and prompt-toolkit, and it has now been added to IPython, meaning users will see autosuggestions and will be able to accept them with ctrl e, ctrl f, or right arrow.

Traceback improvements are one of the more useful areas to have been improved. In the earlier release, error tracebacks for errors happening in code cells showed as a hash. The error traceback is now correctly formatted, showing the cell number in which the error happened. Another traceback improvement comes through integration of the stack_data package; which provide smarter informations in traceback; in particular it will highlight the AST node where an error occurs to narrow down errors.

IPython 8 is available now.

More Information

IPython On GitHub

Related Articles

Jupyter Project Celebrates 20 Year Anniversary

Jupyter 4 Completed By Release Of IPython 4

IPython 5.0-LTS Released  

IPython 3.0 Released 

Python 3 Gains Support and Enthusiasm

Python 3 For Science - A Survey

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


CSS Ecosystem In the Spotlight
06/11/2024

The 2024 edition of the State of CSS has been posted, revealing that the latest features of the language not only do away with extra tooling, but even start taking on tasks that previously requir [ ... ]



Improved Code Completion With JetBrains Mellum
29/10/2024

JetBrains has launched Mellum, a proprietary large language model specifically built for coding. Currently available only with JetBrains AI Assistant, Mellum is claimed to provide faster, sm [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info