On Thu, Nov 29, 2012 at 9:07 AM, lars van gemerden <l...@rational-it.com>wrote:
> > PS: this is somewhat simpler than the actual case i've encountered, and > i haven't tested this exact case, but for now i hope this is enough to get > some of your insight. > > I know for sure that the imports both import the same file, though if i > understand you correctly, it creates 2 different module objects? Are module > object only created on an import statement? > > Yes, Python sees imports of two different absolute module paths and does not recognize them as being the same file, so it imports each separately. This scenario typically arises when your sys.path includes a folder that is actually a module itself. Recommended usage: don't do that. Your sys.path entries should contain modules and packages, not point inside them.
-- http://mail.python.org/mailman/listinfo/python-list