Re:Jurigged – Hot code reloading for Python
by nonameiguess on Friday April 09, 2021 @02:55PM
(#26754556)
Imported modules are compiled to bytecode and frozen on import, so changing the code in-place won't change what actually get run when the code is called unless you clear the bytecode cache and re-import.
importlib provide a reload method for this purpose: https://docs.python.org/3.8/library/importlib.html#importlib...