Why are “.pyo” files created when importing own modules in addons?

Hello,

I thought it may be a good idea to group out some code into small modules. So I created a “resources/lib” directory, added it to “sys.path” and now import the small .py modules.

But for every import a new “.pyo” file is created every time Kodi starts.

I’ve disabled this using “sys.dont_write_bytecode”, but why are they created? Why are they created every time? Is it recommended to use “sub-modules” at all and if so, what are the recommendations when doing so?