[IPython-user] Re: [IPython-dev] I need feedback: new escape for @magics?

Fernando Perez Fernando.Perez at colorado.edu
Wed Sep 29 12:25:25 CDT 2004

Prabhu Ramachandran schrieb:
>>>>>>"JH" == John Hunter <jdhunter at ace.bsd.uchicago.edu> writes:
>>>>>>"Fernando" == Fernando Perez <Fernando.Perez at colorado.edu> writes:
>     Fernando> My current candidate is '/', which somebody (can't
>     Fernando> remember who or where) suggested.  I like it because
>     Fernando> it's a binary operator, so
>     Fernando> /magic foo bar
>     JH> I'm an ipython newbie, so this may be totally offbase, but
>     JH> might this conflict in pysh mode?
> My thoughts exactly.  If there isn't a problem with specifying a full
> path to a file name then I guess '/' is ok.

Yes, this one is a problem.  Bummer.

I could make the code work in the following manner:

/anything/with/slashes/in/it -> works like pysh currently does

/something_with_no_slashes -> considered a magic

This would only leave the rather rare case of trying to run a naked command 
from the root directory out.  This can certainly work, however the 
non-orthogonality of it bothers me a bit.  I don't like users having to 
remember funny special cases of this nature.  I feel it's a cleaner design to 
have _one_ special character for magics, which works uniformly across all 
ipython configurations.

Hmmm...  I'm not too sure what to do here.  Here are a few more ideas just 
thrown in to see how they feel:

%magic  -> I kind of like this one...
.magic  -> not bad, but hard to see in the manuals, and I worry that some day
            the python syntax might allow naked attribute access
*magic ... All these look distinctly less appealing to me

Feedback most welcome...



More information about the IPython-user mailing list