[IPython-user] Custom command completers implemented in SVN

Stefan van der Walt stefan at sun.ac.za
Wed Nov 1 13:01:33 CST 2006

On Wed, Nov 01, 2006 at 11:15:45AM -0700, Fernando Perez wrote:
> >Maybe someone else on a linux machine can try this example and report
> >on what they see -- could be that my setup that is broken.
> Stefan, I think you are mistaken, at least since quite a while.
> Reverting back to 0.7.1:
> IPython 0.7.1.fix1 -- An enhanced Interactive Python.
> ?       -> Introduction to IPython's features.
> %magic  -> Information about IPython's 'magic' % functions.
> help    -> Python's own help system.
> object? -> Details about 'object'. ?object also works, ?? prints more.
> In [1]: fun('/home/'
> Display all 204 possibilities? (y or n)
> In [1]: fun('/home/fperez/'
> Display all 204 possibilities? (y or n)
> In [1]: fun('/home/fperez/'

As I said originally, I wasn't sure whether this ever worked.  Clearly
it never did (I just reverted to 0.6.16_svn to make sure), so sorry
for all the noise! (interesting behaviour on Ville's machine, though)

> Basically, ever since the code has had the ability to close the quote
> mark on an unambiguous completion, it has worked this way.  This could
> be improved, but it would be /new/ functionality, not fixing a
> regression.  The analysis to do is to check whether the end of the
> completion is a filename or a non-empty directory.  If it's a
> filename, we can just close the quotes since nothing else can go after
> that, but if it's a non-empty directory, it's better to not close
> them.

Having the quote close automatically is handy.  Would it be
counter-intuitive if


completed to

'/home/stefan' ?

> The implementation is easy.  I'm busy right now, but I might do it
> tonight if you want it.

It's a minor annoyance (I've never seen anyone else complain), so
really not that important; but if you do get a chance to take a look,
I would appreciate it.


More information about the IPython-user mailing list