cosmicpython / code

Example application code for the python architecture book
Other
2.07k stars 926 forks source link

Should the allocation directory has __init__.py #7

Closed haibin closed 4 years ago

haibin commented 4 years ago

I'm not sure if the question is related to the book. But I keep wondering why the allocation directory does not have a __init__.py.

hjwp commented 4 years ago

I have to admit that I don't really understand the details, but essentially __init__.py became optional in python 3 dot something. https://www.python.org/dev/peps/pep-0420/

hjwp commented 4 years ago

maybe this is a better explanation https://stackoverflow.com/questions/37139786/is-init-py-not-required-for-packages-in-python-3-3

hjwp commented 4 years ago

I added some dunderinits. by the principle of least surprise, it's the sensible thing to do. Thanks for the prompt!