[IPython-dev] refactoring magics

Matthias BUSSONNIER bussonniermatthias@gmail....
Wed Sep 11 13:16:22 CDT 2013

> 1. Leave it completely in the magic writer's hands. 
> 2. Do the expansion in run_line_magic and run_cell_magic and pass in 
> both the raw line and the expanded line. ....
> 3. Provide an API function that users can call inside their magic...
> I'd welcome suggestions on which route people think is best, or whether 
> there's a better way that I'm missing.
> Thanks,
> Greg

What about a decorator ? It does not give author much choice.

Or have the register_magics function take an kwarg which tell it wether or not the string will be expanded.
This one might allow us not to change the current api. 

More information about the IPython-dev mailing list