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


Android 15 Developer Preview Updated
25/03/2024

Google has released Android 15 Developer Preview 2 with changes including better handling of automatic language switching and updates for OpenJDK 17.



Falco On Track To Version 1.0.0
02/04/2024

Falco is a cloud native runtime security tool for the Linux operating system, designed to detect abnormal behavior and warn of potential security threats in real-time. Now it's about to release its fi [ ... ]


More News

raspberry pi books

 

Comments




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