And __init__.py contents will be executed as expected when importing my_package package and you’ll be able to access its contents like you would with your normal package.
Modules will also behave as usual.
If your package is checking __name__ for __main__ it will also work as usual. Although given the fact that we only have 1 file we will no longer be able to call other packages/modules directly from the command line to trigger code conditioned to __name__ having __main__ as its value.
Loader code will automatically compile packages and modules to byte code, before running it. When a module is imported for the first time, or when the specific’s package/module source (not the whole inlined file) is more recent than the current compiled file, a .pyc file containing the compiled code will be created in the same directory as the pinlined .py file.
If the byte code is up to date then it will be used instead, thus avoiding a recompilation, exactly the same as python normally does, with the only exception that all .pyc files will be in the same directory and the filenames will include the full path to the original file.