importing question ?

Kenny Tilton ktilton at nyc.rr.com
Fri Nov 29 18:30:01 EST 2002


> 'from classes import *' brings all the toplevel objects in classes into 
> your local namespace, so you can access them just through the name. 
> Generally, though, I think this is considered bad practice, as it could 
> create overlaps. 

I just ran into this and I do not like it, because I have what I 
consider one little subsystem (Cells) but I have it spread over ten 
source files. Python may end up forcing me into lumping all that code 
into one big source file. I have tried adding "from <cell-source> import 
*", but so far it is not going well. (still trying to come up with a 
small recreatable failure to ask for help on.)

Lisp lets you:

(in-package :cells)

...at the top of several source files, as many as I like. When it loads 
them, everything goes into the Cells namespace (which is fine because it 
is one functional chunk).


-- 

  kenny tilton
  clinisys, inc
  ---------------------------------------------------------------
""Well, I've wrestled with reality for thirty-five years, Doctor,
   and I'm happy to state I finally won out over it.""
                                                   Elwood P. Dowd




More information about the Python-list mailing list