Re: Importing two modules of same name

2016-02-10 Thread Tim Johnson
* dieter [160209 23:03]: > Carl Meyer writes: > > ... > > If you omit the future-import in Python 2.7, `import config` will import > > the neighboring app/config.py by default, and there is no way to import > > the top-level config.py. > > There is the "__import__" builtin function which allows

Re: Importing two modules of same name

2016-02-09 Thread dieter
Carl Meyer writes: > ... > If you omit the future-import in Python 2.7, `import config` will import > the neighboring app/config.py by default, and there is no way to import > the top-level config.py. There is the "__import__" builtin function which allows to specify the "parent package" indirect

Re: Importing two modules of same name

2016-02-09 Thread Tim Johnson
* Carl Meyer [160209 15:28]: > Hi Tim, <...> > The proper way to do this in Python 2.7 is to place `from __future__ > import absolute_import` at the top of flask/app/__init__.py (maybe best > at the top of every Python file in your project, to keep the behavior > consistent). Once you have that f

Re: Importing two modules of same name

2016-02-09 Thread Carl Meyer
Hi Tim, On 02/09/2016 04:23 PM, Tim Johnson wrote: > Before proceding, let me state that this is to satisfy my > curiousity, not to solve any problem I am having. > > Scenario : > Web application developed at /some/dir/sites/flask/ > > If I have a package - let us call it app and in my > /some/d

Importing two modules of same name

2016-02-09 Thread Tim Johnson
Before proceding, let me state that this is to satisfy my curiousity, not to solve any problem I am having. Scenario : Web application developed at /some/dir/sites/flask/ If I have a package - let us call it app and in my /some/dir/sites/flask/app/__init__.py is the following: from config import