byte compiled files and acute neurological disorders

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Jul 30 01:41:50 EDT 2001


Ken Seehof wrote:
> 
> Don't use
>     from mymodule import *
> unless mymodule is completely stable (preferably not yours).
>
> ...
> 
> The problem is that A only gets recompiled if the timestamp on A.py file
> is later than A.pyc (otherwise the compiler assumes that A hasn't changed).
> Now, suppose B changes.  B.pyc gets updated, but A.pyc does not.

There shouldn't be any problem with that. Importing
is done at run-time, not compile-time. The import *
statement in module A will get all the names from
the new version of module B, without anything having
to happen to A.pyc.

If you think you've seen something go wrong because
of this, you must have been confused by some other
problem.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list