我的软件包具有以下结构:
mobilescouter/
__init__.py #1
mapper/
__init__.py #2
lxml/
__init__.py #3
vehiclemapper.py
vehiclefeaturemapper.py
vehiclefeaturesetmapper.py
...
basemapper.py
vehicle/
__init__.py #4
vehicle.py
vehiclefeature.py
vehiclefeaturemapper.py
...
我不确定__init__.py
应如何正确写入文件。
的__init__.py #1
样子:
__all__ = ['mapper', 'vehicle']
import mapper
import vehicle
但是例如应该__init__.py #2
看起来如何?我的是:
__all__ = ['basemapper', 'lxml']
from basemaper import *
import lxml
什么时候应该__all__
使用?