module naming?

Joal Heagney sctheagn at kraken.itc.gu.edu.au
Wed Apr 19 04:29:49 CEST 2000


"Michal Wallace (sabren)" wrote:

> On Mon, 17 Apr 2000, David Arnold wrote:
>
> > -->"Michal" == sabren  <Michal> writes:
> >
> >   Michal> Is there a better way to do this?
> >
> > what about something like
> >
> >    from Record import Record
> >    from Field import Field
> >    from IdxDict import IdxDict
> >
> > in your zdc/__init__.py ?
> >
>
> Hey David,
>
>   That's certainly a lot cleaner! But is there a way to do that and
> not have it load each one of those files every time? There's actually
> more than 3, and even though they're all fairly small, I'd rather not
> have the overhead of loading them until they're needed.
>
> Cheers,
>
> - Michal
> -------------------------------------------------------------------------
> http://www.manifestation.com/         http://www.linkwatcher.com/metalog/
> -------------------------------------------------------------------------

I'm new to the pythoning game, but is there a way to check to see if a file
is loaded. I seem to remember that the from statement doesn't support that,
but maybe you could make a call to a function that does a check on if the
class already exists in program space, and if it doesn't imports it using
the from ... import statement?

Joal Heagney/AncientHart




More information about the Python-list mailing list