How to import classes defined in __init__.py

前端 未结 7 585
你的背包
你的背包 2020-11-29 17:23

I am trying to organize some modules for my own use. I have something like this:

lib/
  __init__.py
  settings.py
  foo/
    __init__.py
    someobject.py
           


        
7条回答
  •  再見小時候
    2020-11-29 17:34

    Edit, since i misunderstood the question:

    Just put the Helper class in __init__.py. Thats perfectly pythonic. It just feels strange coming from languages like Java.

提交回复
热议问题