package.module != module

Rob Hooft R.Hooft at EuroMail.com
Mon Apr 26 03:08:13 EDT 1999


>>>>> "QD" == Quinn Dunkan <quinn at necro.ugcs.caltech.edu> writes:

 QD> I have discovered that apparently python's mechanism for
 QD> discovering if a module has already been imported fails when you
 QD> import a "fully qualified" package previously imported as a
 QD> sister.  i.e.:

Feature.

If you're running a program "publish" from a directory called
"package" that does not make this directory into a package. Hence,
importing "sister" just imports it from the "current directory"
whereas importing "package.sister" initializes the package and then
imports sister from it.

Moral is: don't put "programs" into packages, or always import fully
qualified module names.

I had the same problem before:
  http://www.dejanews.com/[ST_rn=ap]/getdoc.xp?AN=437913465

Regards,


-- 
=====   R.Hooft at EuroMail.net   http://www.xs4all.nl/~hooft/rob/  =====
=====   R&D, Nonius BV, Delft  http://www.nonius.nl/             =====
===== PGPid 0xFA19277D ========================== Use Linux! =========




More information about the Python-list mailing list