News for hackers. Stuff that matters.
Re:I'm Switching to Python and Actually Liking It by moffkalast on Wednesday July 16, 2025 @01:38PM (#44584922)
I would think the dumber thing is having to create an empty file called __init__.py for a package to register as a package. And relative imports being completely fubar.
Re:I'm Switching to Python and Actually Liking It by kolanos on Wednesday July 16, 2025 @02:20PM (#44585321)
> 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.

Re:I'm Switching to Python and Actually Liking It by maleldil on Wednesday July 16, 2025 @04:34PM (#44586529)
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