Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I would think the dumber thing is having to create an empty file called __init__.py for a package to register as a package.

This hasn't been true since Python 3.3. You no longer need a __init__.py for Python to recognize a module, but it can still be useful in many cases.



This is incorrect.

> The __init__.py files are required to make Python treat directories containing the file as packages (unless using a namespace package, a relatively advanced feature).

https://docs.python.org/3/tutorial/modules.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: