How python imports modules
Initializing expensive objects on module level
def calculate is needed in another file and imported there, load data is run when
the function is imported. Best avoided by putting all logic into functions.
This is a pattern should be avoided because:
- It imports everything when most of the time just certain objects are needed
- It is not transparent what objects were imported
Erstellt: June 27, 2022