[IPython-dev] Fwd: Status of pre-0.10 reviews and merges

Fernando Perez fperez.net@gmail....
Wed Apr 8 13:03:53 CDT 2009


On Thu, Apr 2, 2009 at 8:09 PM, Brian Granger <ellisonbg.net@gmail.com> wrote:
> ---------- Forwarded message ----------
> From: Brian Granger <ellisonbg.net@gmail.com>
> Date: Thu, Apr 2, 2009 at 8:09 PM
> Subject: Re: [IPython-dev] Status of pre-0.10 reviews and merges
> To: Jörgen Stenarson <jorgen.stenarson@bostream.nu>
>
>
>> Some random thoughts on the refactoring process:
>>
>> When working on the genutils.py patch I thought that it would be nice to
>> have smaller module files because it is somewhat difficult to navigate huge
>> modules and sometimes it can be difficult to guess in what module I should
>> look for some function.
>
> Yes, partitioning large modules like genutils into more logical
> modules is part of my reorganization plans.  Details to follow.
>
>> All uses of from xx import * should be removed. This is one refactoring that
>> would really benefit from good test coverage.
>
> Definitely!

I should add that genutils is probably the biggest offender, and it's
because it was the code I wrote earliest in ipython's history as a
giant dump-bucket of everything I needed.  It's also by now the *only*
one from which there's ever an 'import *' in our code base.

A while ago I did a first import/entanglement cleanup pass on ipython
and I managed to break most of the worst hairballs we had, being left
only with two things:

- 'from genutils import *'.  I realized there was so much of this in
untested codepaths, that if I changed it to explicit imports the bugs
might only appear for users in the end.  Perhaps now with pyflakes we
could more easily change this to something like 'import genutils as
util' and let pyflakes tell us where all the problems are, I don't
know (I need to get my pyflakes-fu up to speed).

- Magics being bolted into the main object.  This needs to go,
obviously, I was just afraid to completely cut the cord (again, lack
of tests).  But now all magics at least refer to the shell object via
self.shell rather than directly by doing self.* (which they could,
since right now the magic stuff is in the main object).  So cutting
this particular cord shouldn't actually be that hard.

I'm *so* happy to see this finally being tackled, though!

Cheers,

f


More information about the IPython-dev mailing list