mutlifile inheritance problem simplified

Marc maurelius01 at hotmail.com
Sat Mar 23 11:39:46 EST 2002


Aahz wrote:
> 
> In article <3C9C0B45.E3C51B0C at hotmail.com>,
> Marc  <maurelius01 at hotmail.com> wrote:
> >Aahz wrote:
> >> In article <3C9BAB77.B4E17C65 at hotmail.com>,
> >> Marc  <maurelius01 at hotmail.com> wrote:
> >>>
> >>>I'm using Windows NT, Python 1.5.2, and IDLE 0.5
> >>
> >> Try switching to Python 2.1.2 or 2.2; I'm sure that reload() has had
> >> some changeds.
> >
> >OK, I've just tried Python 2.2 and IDLE 0.8.  Same problem.
> >
> >This really seems quite mysterious?  I'm surprised that others haven't
> >run into this.  I'm sure I'm not the first person to use reload, or the
> >first to inherit from a class into different files.
> 
> Not many people do use reload(), in my experience.  I'm pretty
> knowledgeable about Python, I think, and I've been pretty regular on
> comp.lang.python for almost three years.  It's not interesting enough to
> me personally to invest much of my time, I'm afraid.  ;-)  I still
> haven't seen any clear explanation from you for why you need to use
> reload() in the first place.
> --
> Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/
> 
> "We should forget about small efficiencies, about 97% of the time.
> Premature optimization is the root of all evil."  --Knuth


I'm wondering whether or not this is a bug, which
I would report, or whether I'm doing something
incorrectly.  I can accept that others don't use
reload much, but it seems that identifying bugs in
the language is good for the language, or
identifying known errors in my usage is good for
me.

For myself, I use reload all the time.  Here's an
example.  For my current task, I'm analysing large
data sets (~.01-30 GB), never doing the same
analysis twice.  This involves many steps, and a
complete analysis takes alot of time about 20
minutes - 50+ hours.  Most of this is done using
old classes that I've written in different files
and many of these inherit from base classes in
other files.  

The goal is to write an analysis script and let it
run, but, of course, it rarely works straight
away.  I run stuff from IDLE.  If the analysis
bombs, I can catch the exception and pickup where
I left off without losing what I've already done: 
IDLE just waits for me to notice the exception,
then using reload, I can modify the classes that
caused the problem, even a base class that I wrote
written 4 years ago and is ten layers deep in an
inheritance tree, or using numbered DLLs I can
even modify a C extension on the fly, all without
losing anything.  Then just rerun, picking up
where I left off.  This is great, and I don't want
to give it up.  I can't see a reanable way to
restart python every time I have an error.

Anyway, I know this hasn't revived your interest
in reload.  I expect it's use is very task
specific.  I've found it extremely useful.

Marc



More information about the Python-list mailing list