[IPython-dev] Magics, aliases, namespaces

Fernando Perez Fernando.Perez at colorado.edu
Tue Jun 29 10:29:11 EDT 2004


Ville Vainio wrote:
>>But the order of the day will be more like:
>>
>>- Make Magic and Logger not be mixins, but without further 
>>architectural cleanup.  Just pull them out of the main class and make 
>>sure everything continues to work.  It may be
> 
> 
> Shouldn't this be rather simple, or am I misunderstanding something? 
> Just implement only one function in Magic, e.g. magic_execute. Then the 
> "magic handler" would return the command to be executed as

The problem is that in many places, the Magic functions access shell 
attributes directly (since it's a mixin).  A boundary needs to be drawn 
between the two.  Same for logger.  This is easy, it just needs to be done 
carefully to make sure all codepaths are taken into account.

> Perhaps I might be able to put in some hours every now and again. I'm 
> not sure how "serious" commitment I can make, but you could nevertheless 
> put up some "needs to be done, and how to go about it" tasks to the 
> ipython web page / wiki / whatever. I'll see if there's something I 
> would like to do.
> 
> BTW, one thing that you could even do for the next release: magics for
> 
> @bookmark  <bookmarkname>   (associate <bookmarkname> with current dir)
> 
> @cdb <bookmarkname>     (cd bookmark, change to dir identified by 
> <bookmarkname>

There's your first project.  Send me a patch :)

> BTW, I'm going to post a little bit of PR/advocacy brainstorming on 
> c.l.py soon, probably today. I'm having some wild ideas again ;-).

I saw that, thanks.  But I (Fernando Perez) wrote ipython, not Francois Pinard 
(though he has sent me useful ideas and comments in the past). :)

Cheers,

f




More information about the IPython-dev mailing list