Just define a class in foo/bar/__init__.py
with the name config
and that will be imported. But why don't you just change the config.py
?
In [4]: !ls foo
__init__.py bar/
In [5]: !ls foo/bar
__init__.py config.py
In [6]: !cat foo/bar/__init__.py
class config(object):
pass
In [7]: from foo.bar import config
In [8]: type(config)
Out[8]: type
$ echo "" > foo/bar/__init__.py
$ ipython
In [1]: from foo.bar import config
In [2]: type(config)
Out[2]: module