[IPython-dev] what goes wrong with %%file

Fernando Perez fperez.net at gmail.com
Sun May 12 17:22:05 EDT 2013


On Sun, May 12, 2013 at 8:45 AM, Matt Davis <jiffyclub at gmail.com> wrote:
> I agree renaming %%file to %%savefile would be a good idea so it's clear
> it's a one-way process.

Yes, in hindsight, the name 'file' was probably a sub-optimal choice:
given that the purpose of the function is to take a (potentially
destructive) action, it should be named as  a verb to make that
unambiguous.

I don't want to have it blend magically the behavior of `%load`, which
already works perfectly fine and is well named.  But renaming %%file
is probably a good idea, keeping a stub %%file for a release of two
that just prints a deprecation message and forwards the call to the
new name.

Potential contenders: savefile, writefile, filesave, and _-separated
versions thereof.  Technically we *could* use '-' in magic names,
since they don't need to conform to python syntax.  Perhaps
'file-save' is a bit more readable and more finger-friendly than an
underscore...

I'm leaning towards 'filesave', as it follows the 'File->Save' pattern
of most menus and will tab-complete from the word 'file', which is the
name we were already using.

Thoughts?

f



More information about the IPython-dev mailing list