r/pythontips • u/DoomLimpio • Feb 29 '24
Meta code in __init__.py
Hi there!
Recently, I've started working in a new team, and they have several practices that, I won't say are wrong, but seem a bit odd to me. One thing that caught my attention is how they're creating classes/functions inside __init__.py files. In my experience, those files are usually kept empty or just handle basic imports, acting more like an interface when you import the package.
What are your thoughts on this?
13
Upvotes
View all comments
Show parent comment
1
u/DoomLimpio Feb 29 '24
They use this files to store abstract classes, while I use to set them on abc.py or something similar