import packet.module without importing packet.__init__ ?

Gelonida N gelonida at
Sun Sep 11 02:05:13 CEST 2011


I am little shaky with how exactly python imports packages / modules etc.

Is it possible to import a module from a packet without importing its ?

Full example:

# ---------------------
print "starting application"
import mypacket.module1

# ---------------------
print "importing __init__"

# ---------------------
print "importing module1"

The output, that I get with python 2.6 is
$ python
> starting application
> importing __init__
> importing module1

Under certain circumstances I'd like to avoid the implicit import

Due to other constrains of my project I am obliged to have a
non empty

More information about the Python-list mailing list