[IPython-user] Deprecations galore

Fernando Perez fperez.net@gmail....
Thu May 24 12:30:15 CDT 2007


On 5/24/07, Ville M. Vainio <vivainio@gmail.com> wrote:
> Inspired by recent cleanups and %r magic, I went off and kinda
> deprecated bunch of magics. I moved them from Magic.py to
> ipy_legacy.py. No worries, the default profile still imports
> ipy_legacy but e.g. "sh" profile does not, in the interest of
> providing leaner meaner IPython to those who are not slaves of (bad)
> habits ;-)
>
> Here they are in all their splendour:
>
> [IPython\Extensions]|17> grep "def magic_" ipy_legacy.py
> def magic_pdef(self, parameter_s='', namespaces=None):
> def magic_pdoc(self, parameter_s='', namespaces=None):
> def magic_psource(self, parameter_s='', namespaces=None):
> def magic_pfile(self, parameter_s=''):
> def magic_rehash(self, parameter_s = ''):
> def magic_dhist(self, parameter_s=''):
> def magic_Quit(self, parameter_s=''):
> def magic_p(self, parameter_s=''):
> def magic_r(self, parameter_s=''):
> def magic_automagic(self, parameter_s = ''):
> def magic_autocall(self, parameter_s = ''):
>
> Rationale for each is in ipy_legacy.py in svn.

I'm happy with the cleanup, except:

> def magic_r(self, parameter_s=''):

This was actually put in at user requests long ago, let's not
deprecate it.  Yes, people have written to me saying they love it and
use it a lot, so please put it back.

> def magic_p(self, parameter_s=''):

For users with autocall active, this one-letter shortcut is a handy
way of seeing values.  In pdb the p command has the exact same
behavior, so the consistency of interface is good.  And the code is a
one-liner, so this one also goes back in.

> def magic_autocall(self, parameter_s = ''):

Since autocall is so finicky and can have side effects, I want its
control to be always visible as a top-level magic, not via the
slightly more obscure _ip.options.xxx route (which most normal users
who don't have a thorough mental map of the IPython structure are
likely not to remember).  It's much easier to remember "oh, it's an
'auto-something' magic, I'll just type %auto<TAB> and see what comes
up" than exploring _ip.options for most users.

The reason these two need to be moved back where they were is because
eventually, the _legacy stuff may just die in the chopping block of
cleanups.  Since those two are not really meant for permanent removal,
I don't want to put their head so close to the blade.

Also, please refrain from committing sources with Windows end-of-line
markers into the tree.  Editing files full of ^M characters is a pain.
 Either adjust your editor or fix the SVN file properties.

Cheers,

f


More information about the IPython-user mailing list