'why .pyc file isn't modified after script is updated and rerun?

When I run my python script for the first time, I can find the cached bytecode file in the __pycache__ folder. When I make a few changes and run it again, I see the .pyc file isn't modified (even though the script runs as expected).

I guess the new bytecode must be generated somehow in memory.

Why isn't it modified? Is there a way I can find the modified file?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source