problems with circular references

jimh jim at jim.jim
Thu Mar 28 12:47:59 EST 2002


> >
> > I will have to think about that one.  When a class accesses the
> > MessageCatalog, it may be requesting message text from _other_ classes'
> > errors.  Also, these are often called from cgi scripts, so they are run
as
> a
> > one-shot deal.  Also(!), the case of an error is (theoretically)
uncommon
> > and the MessageCatalog is only instantiated if an error occurs.  That
way,
> > if no error occurs, there is no overhead with importing the
> MessageCatalog.
> >
> Bear in mind that the import will only cause the module to be executed
once
> no matter how many times it is imported. So importing it may not be as
much
> of an ovberhead as you imagine (especially since you seem to be happy to
> import fifty other modules to make up your program).
>
> regards
>  Steve
>

Just a small comment: during "normal" operation of the program (actually a
transient cgi script), only a few of the 50 files are imported.  Only when
an error occurs (in which case we no longer care about performance) is the
MessageCatalog (and the remaining 50 files) imported.

Jim






More information about the Python-list mailing list