[IPython-dev] Plan for empowering aliases

Ville M. Vainio vivainio@gmail....
Mon Jun 4 10:55:53 CDT 2007


A while age I posted about getting rid of the aliases, and the "shadow
namespace". Now here's a simple, concrete plan I have for empowering
aliases - putting callables in the 'alias table', and having a way to
call them with simple syntax.

This will allow us to get over the 'alias == system command'
limitation, without polluting the user namespace.

So, if the alias 'foo' maps to a callable in the alias_table, 'foo 1,
2'  will be translated to:

_sh.foo(1,2)

(where args are translated via normal autocall stuff).

_sh stands for "shadow namespace" here. Current aliases will *not* be
available in the _sh namespace, but the translatable callables will be
both in _sh and alias_table.

I think the shadow namespace will be an (initially empty) module named
'shadowns', referred to by '_sh' shorthand in the user_ns.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


More information about the IPython-dev mailing list