Hiding module imports in package

前端 未结 2 1726
深忆病人
深忆病人 2021-01-18 18:55

I have a small package that has a few dependencies such as pandas and gensim. The file structure is like so

/package
    __init__.py
    agg_clean.py
         


        
2条回答
  •  遥遥无期
    2021-01-18 19:36

    This is really just a side-effect of the way that python modules work. Anything that you import into a module will be available as a top-level object in that module. Most people don't worry about it and simply use the canonical import path.

提交回复
热议问题