Project organization and import

Diez B. Roggisch deets at nospam.web.de
Tue Mar 6 11:42:13 EST 2007


> I'd like to point out something though. More than one of the people
> who responded have implied that I am bringing my prior-language
> mindset to Python, even suggesting that my brain isn't built for
> Python. ;) In fact I think it's the other way around. I am struggling
> to take full advantage of the fact that Python is an interpreted
> language, to use Python in the most "Pythonic" way. You guys are
> telling me that's broken and I should go back to a workflow that is
> identical in spirit, and not necessarily any faster than I would use
> with a compiled language. While that might be the right answer in
> practice, I don't feel like it's a particularly "good" answer, and it
> confirms my initial impression that Python package management is
> broken.
> 
> I think you should be asking yourselves, "Did we all abandon reload()
> because it is actually an inferior workflow, or just because it's
> totally broken in Python?"

Sorry, but I fail to see the point of your argumentation.

Reloading a module means that you obviously have some editor open you code
your module in, and an interactive interpreter running where you somehow
have to make the 

reload(module)

line (re-)appear, and then most probably (unless the pure reloading itself
triggers some testing code) some other line that e.g. instantiates a class
defined in "module"

Now how exactly does that differ from having a test.py file containing

import module
<do-something>

and a commandline sitting there with a 

python test.py

waiting to be executed, easily brought back by a single key-stroke.

Especially if <do-something> becomes more that some easy lines brought back
by the command line history.

I've been writing python for a few years now, to programs the size of a few
K-lines, and _never_ felt the slightest need to reload anything. And as
there have been quite a few discussions like this in the past few years,
IMHO reload is a wart and should be removed.

Diez





More information about the Python-list mailing list