What's new in IPython 0.7.3

Python 2.5 support

IPython now properly supports Python 2.5. Numerous small annoyances encountered with Python 2.5 have been fixed, and working with Python 2.5 even provides a slightly better user experience in some areas (example: try pressing tab after import).

Tab completer improvements

The most visible change is that you can now easily create your own completers to make using various commands quicker. Several new completers are provided (for apt-get, import, svn, hg, bzr, %run, %cd). Especially the cd completer makes directory bookmarks and directory history a breeze to navigate. See http://ipython.scipy.org/moin/Cookbook/CustomCompleters in the IPython cookbook.

Also the old completers have been improved and polished in various areas.

Debugger improvements

Rocky Bernstein has provided a series of patches to integrate IPython with pydb, an extended Python debugger. See http://bashdb.sourceforge.net/pydb/ for more information.

If you execute the "%debug" magic command after getting a traceback, you will be thrown to a post-mortem debugger session. This solves most of the cases where you would normally have had to enable %pdb and re-run the offending code.

Alias improvements

Aliases that are %store'd (try it out!) can be unstored with %unalias.

%alias without arguments now shows the most interesting aliases last.

Aliases are now expanded deeper than just one level. Assume that you have:

%alias vlc q:/opt/VLC/vlc.exe
%alias playmusic vlc q:/mp3/foo.mp3

Then, executing 'playmusic' expands to 'q:/opt/VLC/vlc.exe q:/mp3/foo.mp3', instead of just 'vlc q:/mp3/foo.mp3' (the old behaviour). This can cause problems in rare cases (e.g. "alias dir ls; alias ls ls -F" now expands "dir" to "ls -F" and not just "ls", which may not be what you expected).

Magic function improvements

  • %debug (see above)
  • %cpaste strips >'s from the beginning of line to allow code pasting from emails.
  • %run: Save and restore readline history. Allow running IPython batch files (with .ipy extension).
  • %page: -r ("raw") switch prevents pretty printing, prints the object as string directly.

New hooks

  • generate_prompt, generate_output_prompt: Generate a prompt through a function for full customizability
  • complete_command: Introduce a new custom completer. See 'Tab completer improvements'.

New extensions

Some new extensions have been added - you can enable them by just importing them, e.g. in ipy_user_conf.py.

  • ipy_pydb: %pydb magic
  • ledit: %led magic, a little list-of-strings/whatever editor
  • ipy_signals: ignore ctrl+C signal in ipython while executing system commands, for more shell-like experience
  • jobctrl: allows you to launch background jobs by & prefix (e.g. '&notepad a.txt'). Works even on win32!

IPipe improvements

  • ibrowse: Commands that require an input (goto, find, findbackwards) have a history now. The following commands have been added: hideattr hides the attribute under the cursor, unhideattrs makes all attributes visible again, refresh refreshes the screen by restarting the iterator, refreshfind does the same, but tries to go back to the same object the cursor was on before the refresh. ibrowse now supports terminal resizing (when running on Python 2.5).
  • Pipes that use expressions strings (ifilter, ieval, etc.) should be faster now as the string is compiled into a code object. Handling ob attributes in the __xattrs__() implementation is now much more object oriented and extensible. Added dirs and files argument to ils. xrepr(), xiter() and xattrs() are now generic functions (using Philip J. Eby's simplegeneric package). xiter() no longer supports a mode argument (the same functionality is available via iterable attributes).

Third party modules

  • path has been updated to version 2.1.
  • Philip J. Eby's simplegeneric package has been added in IPython/external.

Deprecated functionality

These still work, but give a DeprecationWarning?. They may or may not work in future versions.

  • ipsystem: use _ip.system instead
  • ipalias: unnecessary. Noninteractive code can execute ip.system(ip.IP.expand_aliases()) instead
  • ipmagic: use _ip.magic instead

ipythonrc files should no longer be used for configuration. They will not be deprecated in the near future, but editing ipy_user_conf.py is a superior, more reliable approach. See http://ipython.scipy.org/moin/IpythonExtensionApi

Upgrade notes

If you are upgrading from a previous version of IPython, you *do* need to run %upgrade (or delete your .ipython directory).

Contributors

The Core IPython team consists of Fernando Perez (original author and main dictator), Ville Vainio (maintainer of the stable branch), Walter Doerwald (ipipe extension maintainer), Joergen Stenarson (pyreadline maintainer).

The following people have provided patches that went into 0.7.3:

  • David Huard: display correct docstring for 'property' attributes
  • Kov Chai: ipython.el patches
  • Darren Dale: qt4agg matplotlib backend support for pylab mode
  • Stefan van der Walt: %cpaste enhancement, ipython.el fix,
  • Jorgen Cederlof: multiline editing for readline history. Try it out by pressing "up" after defining a multiline function interactively (does not work on win32)!
  • William Stein (SAGE): Customizable source extractor for OInspect.py
  • Kirill Smelkov: Numerous fixes in code and documentation
  • Will Maier: BSD compatibility fixes
  • Rocky Bernstein: Pretty much all of the pydb integration functionality.