Apparent "double imports" (was: Naming convention for in-house modules (Newbie question))

Ian Kelly ian.g.kelly at gmail.com
Thu Feb 9 14:02:03 EST 2012


On Thu, Feb 9, 2012 at 11:53 AM, HoneyMonster <someone at someplace.invalid> wrote:
> One issue I have run into, which may or may not be a problem: I am
> finding that modules in the in-house "library" package sometimes have to
> import modules like sys and os, which are also imported by the "calling"
> module. Is this a problem or an overhead, or does it just result in two
> names for the same object?

Two names for the same object.  When a module is imported, the module
object is stored in the sys.modules dict.  Further imports of the same
module just return the same module object from sys.modules.



More information about the Python-list mailing list