0

Most of the __ init__.py of a project I work on (python 3.7) are empty but some have code in it.

I am in charge of refactoring.

Should I move the code out of the __ init__.pys as much as possible ?

Eli O.
  • 1,543
  • 3
  • 18
  • 27
  • Unfortunately it does not – Eli O. Dec 23 '22 at 11:26
  • 1
    That entirely depends on what the code does. Everything in Python is code. Unless `__init__.py` is completely empty, yes, it will contain code. And it's okay for it to contain code. Only *what kind of code* may be debatable and very much depends on the specific situation. – deceze Dec 23 '22 at 11:27

0 Answers0